Systemd run daemon at boot like System V

Luke Moll

I'm configuring a Java app to run at boot using jsvc, following this tutorial which uses systemv (init.d). I'm running Ubuntu 16.04, which uses systemd, and am having a hard time finding exactly what I need to do to have it run at boot, and stop at shutdown.

So far I know I need to create a service with Type=forking as the jsvc_exec command which starts/stops the app forks once it has run.

What else do I need to include to have it work in a similar way to the systemv script from the tutorial?

Thanks

Alex

Something like this:

 [Unit]
 Description=Description of daemon
 After=network.target

 [Service]
 #WorkingDirectory=/path/to/program/
 #User=
 #Group=
 Type=forking

 ExecStart=/path/to/program/program start
 ExecStop=/path/to/program/program stop
 #PIDFile=/path/to/pid/file.pid
 #RestartSec=15
 #Restart=always

[Install]
WantedBy=multi-user.target

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How to run gunicorn as systemd daemon

분류에서Dev

How do I make my systemd service run via specific user and start on boot?

분류에서Dev

Normal boot (systemd) not working

분류에서Dev

start systemd-nspawn/systemd container on boot

분류에서Dev

System V처럼 부팅시 Systemd 실행 데몬

분류에서Dev

Systemd is unmounting my /boot partition

분류에서Dev

Systemd timeout because it doesn't detect daemon forking

분류에서Dev

systemd call bash script to create a symlink before daemon process

분류에서Dev

How to run a script with systemd right before shutdown?

분류에서Dev

System setup using systemd-nspawn

분류에서Dev

systemd: Failed to start Create System Users

분류에서Dev

Internal SSD + External SSD (via firewire) RAID 1 and boot drive version control (like system-wide git)

분류에서Dev

boot2docker Cannot connect to the Docker daemon. Is the docker daemon running on this host?

분류에서Dev

How do I setup a systemd service to be started by a non root user as a user daemon?

분류에서Dev

Is there a git-like file system?

분류에서Dev

nfs boot hangs after systemd-networkd starts

분류에서Dev

Confused why systemd service doesn't start at boot

분류에서Dev

systemd-boot 메뉴 표시 / 숨기기

분류에서Dev

How to see what command is being run by a systemd .timer file?

분류에서Dev

Enabled systemd service not running at startup, but works when run manually

분류에서Dev

Arch Linux에서 / etc / systemd / system / 삭제

분류에서Dev

What is the right place for systemd services created by the system adminstrator on Debian?

분류에서Dev

retrieving date of system boot with regex

분류에서Dev

I would like to run a command as a bash script?

분류에서Dev

Emacs-like keybindings system-wide?

분류에서Dev

Vi like editing operating system wide?

분류에서Dev

Advanced "Like" system with defense from click fraud

분류에서Dev

While trying to install git, "errors were encountered while processing: runit, git-daemon-run"

분류에서Dev

How to run "fsck -y" on next boot in Ubuntu

Related 관련 기사

  1. 1

    How to run gunicorn as systemd daemon

  2. 2

    How do I make my systemd service run via specific user and start on boot?

  3. 3

    Normal boot (systemd) not working

  4. 4

    start systemd-nspawn/systemd container on boot

  5. 5

    System V처럼 부팅시 Systemd 실행 데몬

  6. 6

    Systemd is unmounting my /boot partition

  7. 7

    Systemd timeout because it doesn't detect daemon forking

  8. 8

    systemd call bash script to create a symlink before daemon process

  9. 9

    How to run a script with systemd right before shutdown?

  10. 10

    System setup using systemd-nspawn

  11. 11

    systemd: Failed to start Create System Users

  12. 12

    Internal SSD + External SSD (via firewire) RAID 1 and boot drive version control (like system-wide git)

  13. 13

    boot2docker Cannot connect to the Docker daemon. Is the docker daemon running on this host?

  14. 14

    How do I setup a systemd service to be started by a non root user as a user daemon?

  15. 15

    Is there a git-like file system?

  16. 16

    nfs boot hangs after systemd-networkd starts

  17. 17

    Confused why systemd service doesn't start at boot

  18. 18

    systemd-boot 메뉴 표시 / 숨기기

  19. 19

    How to see what command is being run by a systemd .timer file?

  20. 20

    Enabled systemd service not running at startup, but works when run manually

  21. 21

    Arch Linux에서 / etc / systemd / system / 삭제

  22. 22

    What is the right place for systemd services created by the system adminstrator on Debian?

  23. 23

    retrieving date of system boot with regex

  24. 24

    I would like to run a command as a bash script?

  25. 25

    Emacs-like keybindings system-wide?

  26. 26

    Vi like editing operating system wide?

  27. 27

    Advanced "Like" system with defense from click fraud

  28. 28

    While trying to install git, "errors were encountered while processing: runit, git-daemon-run"

  29. 29

    How to run "fsck -y" on next boot in Ubuntu

뜨겁다태그

보관