Re: Schedule reboot in *.service file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 7, 2019 at 6:14 AM Jeffrey Walton <noloader@xxxxxxxxx> wrote:
>
> On Thu, May 16, 2019 at 11:02 AM Mike Gilbert <floppym@xxxxxxxxxx> wrote:
> >
> > On Thu, May 16, 2019 at 4:50 AM Lennart Poettering
> > <lennart@xxxxxxxxxxxxxx> wrote:
> > >
> > > On Mi, 15.05.19 15:53, Jeffrey Walton (noloader@xxxxxxxxx) wrote:
> > >
> > > > if [[ "$NEEDS_REBOOT" -eq 1 ]]
> > > > then
> > > >     echo "Scheduling reboot in 10 minutes"
> > > >     reboot -r 10
> > >
> > > This syntax is not understood by systemd:
> > >
> > > https://www.freedesktop.org/software/systemd/man/reboot.html#
> > >
> > > If you want to schedule some command to be invoked at some future time, use:
> > >
> > >         systemd-run --on-active=10s echo "Hello World"
> >
> > Another option would be to use "shutdown -r +10", which systemctl does
> > understand. This will schedule a reboot via systemd-logind.
>
> Thanks Mike.
>
> I was missing the +10, doh...
>
> But fixing it resulted in a new issue:
>
> systemd[1]: Starting Update the system once a day without
> system-update[7454]: Updated package list
> systemd[1]: [/etc/systemd/system/system-update.service:7]
> systemd[1]: [/etc/systemd/system/system-update.service:7]
> system-update[7454]: Upgraded system
> system-update[7454]: Purging old packages
> system-update[7454]: Scheduling reboot in 10 minutes
> system-update[7454]: reboot: invalid option -- 'r'

Did you replace "reboot" with "shutdown -r"? They are separate
commands, and only "shutdown -r" supports the "+10" syntax.
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux