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

Emacs-like keybindings system-wide?

분류에서Dev

Is there a git-like file system?

분류에서Dev

retrieving date of system boot with regex

분류에서Dev

Vi like editing operating system wide?

분류에서Dev

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

분류에서Dev

start systemd-nspawn/systemd container on boot

분류에서Dev

How to run a script with systemd right before shutdown?

분류에서Dev

Systemd is unmounting my /boot partition

분류에서Dev

How to run gunicorn as systemd daemon

분류에서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

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

분류에서Dev

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

분류에서Dev

Advanced "Like" system with defense from click fraud

분류에서Dev

System setup using systemd-nspawn

분류에서Dev

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

분류에서Dev

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

분류에서Dev

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

분류에서Dev

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

분류에서Dev

Normal boot (systemd) not working

분류에서Dev

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

분류에서Dev

Systemd timeout because it doesn't detect daemon forking

분류에서Dev

nfs boot hangs after systemd-networkd starts

분류에서Dev

systemd: Failed to start Create System Users

분류에서Dev

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

분류에서Dev

Confused why systemd service doesn't start at boot

분류에서Dev

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

분류에서Dev

systemd call bash script to create a symlink before daemon process

분류에서Dev

systemd-boot 메뉴 표시 / 숨기기

Related 관련 기사

  1. 1

    Emacs-like keybindings system-wide?

  2. 2

    Is there a git-like file system?

  3. 3

    retrieving date of system boot with regex

  4. 4

    Vi like editing operating system wide?

  5. 5

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

  6. 6

    start systemd-nspawn/systemd container on boot

  7. 7

    How to run a script with systemd right before shutdown?

  8. 8

    Systemd is unmounting my /boot partition

  9. 9

    How to run gunicorn as systemd daemon

  10. 10

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

  11. 11

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

  12. 12

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

  13. 13

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

  14. 14

    Advanced "Like" system with defense from click fraud

  15. 15

    System setup using systemd-nspawn

  16. 16

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

  17. 17

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

  18. 18

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

  19. 19

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

  20. 20

    Normal boot (systemd) not working

  21. 21

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

  22. 22

    Systemd timeout because it doesn't detect daemon forking

  23. 23

    nfs boot hangs after systemd-networkd starts

  24. 24

    systemd: Failed to start Create System Users

  25. 25

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

  26. 26

    Confused why systemd service doesn't start at boot

  27. 27

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

  28. 28

    systemd call bash script to create a symlink before daemon process

  29. 29

    systemd-boot 메뉴 표시 / 숨기기

뜨겁다태그

보관