-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 01.03.2015 Andrei Borzenkov wrote:
В Sun, 1 Mar 2015 01:55:50 -0300 Cristian Rodríguez <crrodriguez@opensuse.org> пишет:
[advantages/disadvantages of type=notify over type=oneshot]
In this case, the services ordered After= your custom service will not start until it PID1 gets notifed that the startup of your service is complete.
Which is what I want to achieve. And what oneshot does, too, right?
This is oneshot service - systemd waits until it is *finished* before starting dependent services.
I'm confused.
I thought "TimeoutSec=0" (or 600 or ...) was exactly for this kind of long running commands?
TimeoutStartSec= in this case.
But it is disabled for oneshot services anyway.
More confused. For the record, or the next one as confused as I am, this worked (where foobar.service is my service of type oneshot): - -----------------------
$systemctl cat display-manager.service # /usr/lib/systemd/system/display-manager.service [Unit] Description=X Display Manager Requires=var-run.mount After=ypbind.service gpm.service time-sync.target winbind.service acpid.service Wants=remote-fs.target dbus.socket systemd-user-sessions.service After=remote-fs.target dbus.socket systemd-user-sessions.service
[Service] Type=forking PIDFile=/var/run/displaymanager.pid ExecStart=/usr/lib/X11/display-manager start ExecStop=/usr/lib/X11/display-manager stop ExecReload=/usr/lib/X11/display-manager reload KillMode=process
[Install] WantedBy=graphical.target Alias=xdm.service
# /etc/systemd/system/display-manager.service.d/wait_for_foobar.conf [Unit] Requires=foobar.service After=remote-fs.target dbus.socket systemd-user-sessions.service foobar.service
$systemctl cat foobar.service [Unit] Description="foobar" ConditionFileIsExecutable=/path/to/script.sh After=basic.target
[Service] Type=oneshot ExecStart=/path/to/script.sh TimeoutSec=0 RemainAfterExit=yes
[Install] WantedBy=multi-user.target
Regards, Johannes - -- Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read. (Groucho Marx) -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with SeaMonkey - http://www.enigmail.net/ iEYEARECAAYFAlTytWgACgkQzi3gQ/xETbI+4ACfa3NRRbIc+v4y/B+jAHnZ5moa pycAmwfrYoWiMDuDQGjHJALRckJI/aPh =GTT/ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org