On Wed, 09.11.16 21:11, zerons (sironhide0n...@gmail.com) wrote:

> Hi everyone.
> 
> Everyday, I need to do something like `git pull` after system
> bootup and `git push` before shutdown. I am using Ubuntu 16.04.
> I have tried to put some script into /etc/rc0.d/, /etc/rc6.d/,
> each time the script runs, the network has been stopped, so I 
> turn to systemd.
> 
> 
> === Here is a test .service file.
> [Unit]
> Description=test systemd
> Conflicts=reboot.target
> After=network-online.target
> Wants=network-online.target

If you only care about shutdown, then After=network.target shouls
suffice, as long as your network management service properly orders
itself against that. See systemd.special(7) for details on this.

Note that systemd only provides a number of hooks we document
semantics for, but it's up to downstream packages to actually honour
these correctly.

Lennart

-- 
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to