On Wed, 05.10.16 14:53, Raghavendra. H. R (raghuh...@gmail.com) wrote:

> Hi All,
> I'm a newbie in Systemd init system and I'm trying to auto boot/start my
> service in systemd. But my service gets only enabled and it never runs
> automatically.
> I modifying my unit file to depend on sysinit.target and multi-user.target
> by making use of I used *After=* this also didnt help.
> *I would like to do something in my unit file from which systemd starts my
> service automatically after starting it's own system related services. *
> Can anyone help me regarding this ?
> My sample service
> =============
> [Unit]
> Description=Hey Bings
> [Service]
> ExecStart="Run an executable"
> [Install]
> WantedBy=multi-user.target *or* sysinit.target

You want to use multi-user.target here. "sysinit.target" is only for
special early-boot services.

After dropping in this file use "systemctl enable ..." to hook the
unit into the boot process for subsequent boots. To also start it
immediately, use "systemctl start ...". You may also do both
operations in one go by using "systemctl enable --now ...".


Lennart Poettering, Red Hat
systemd-devel mailing list

Reply via email to