Eu quero executar live555MediaServer como um daemon no CentOS 7. Eu crio o seguinte script de inicialização.
live555.service (/usr/lib/systemd/system/live555.service)
[Unit]
Description=Live555 Media Server
Requires=network-online.target
After=network.target network-online.target local-fs.target
[Service]
Type=simple
Restart=on-failure
ExecStart=/opt/live555/live555MediaServer
WorkingDirectory=/opt/live555
E ative o serviço
systemctl enable live555
Mas o servidor de mídia nunca é iniciado após a inicialização, posso iniciá-lo manualmente sem problemas.
Status após a inicialização:
[root@localhost ~]# systemctl status live555
● live555.service - Live555 Media Server
Loaded: loaded (/usr/lib/systemd/system/live555.service; static; vendor preset: disabled)
Active: inactive (dead)
dependências de lista do systemctl live555
[root@localhost ~]# systemctl list-dependencies live555
live555.service
● ├─-.mount
● ├─system.slice
● ├─basic.target
● │ ├─microcode.service
● │ ├─rhel-autorelabel-mark.service
● │ ├─rhel-autorelabel.service
● │ ├─rhel-configure.service
● │ ├─rhel-dmesg.service
● │ ├─rhel-loadmodules.service
● │ ├─[email protected]
● │ ├─paths.target
● │ ├─slices.target
● │ │ ├─-.slice
● │ │ └─system.slice
● │ ├─sockets.target
● │ │ ├─dbus.socket
● │ │ ├─dm-event.socket
● │ │ ├─systemd-initctl.socket
● │ │ ├─systemd-journald.socket
● │ │ ├─systemd-shutdownd.socket
● │ │ ├─systemd-udevd-control.socket
● │ │ └─systemd-udevd-kernel.socket
● │ ├─sysinit.target
● │ │ ├─dev-hugepages.mount
● │ │ ├─dev-mqueue.mount
● │ │ ├─kmod-static-nodes.service
● │ │ ├─lvm2-lvmetad.socket
● │ │ ├─lvm2-lvmpolld.socket
● │ │ ├─lvm2-monitor.service
● │ │ ├─plymouth-read-write.service
● │ │ ├─plymouth-start.service
● │ │ ├─proc-sys-fs-binfmt_misc.automount
● │ │ ├─sys-fs-fuse-connections.mount
● │ │ ├─sys-kernel-config.mount
● │ │ ├─sys-kernel-debug.mount
● │ │ ├─systemd-ask-password-console.path
● │ │ ├─systemd-binfmt.service
● │ │ ├─systemd-firstboot.service
● │ │ ├─systemd-hwdb-update.service
● │ │ ├─systemd-journal-catalog-update.service
● │ │ ├─systemd-journal-flush.service
● │ │ ├─systemd-journald.service
● │ │ ├─systemd-machine-id-commit.service
● │ │ ├─systemd-modules-load.service
● │ │ ├─systemd-random-seed.service
● │ │ ├─systemd-sysctl.service
● │ │ ├─systemd-tmpfiles-setup-dev.service
● │ │ ├─systemd-tmpfiles-setup.service
● │ │ ├─systemd-udev-trigger.service
● │ │ ├─systemd-udevd.service
● │ │ ├─systemd-update-done.service
● │ │ ├─systemd-update-utmp.service
● │ │ ├─systemd-vconsole-setup.service
● │ │ ├─cryptsetup.target
● │ │ ├─local-fs.target
● │ │ │ ├─-.mount
● │ │ │ ├─boot.mount
● │ │ │ ├─rhel-import-state.service
● │ │ │ ├─rhel-readonly.service
● │ │ │ └─systemd-remount-fs.service
● │ │ └─swap.target
● │ │ └─dev-mapper-centos\x2dswap.swap
● │ └─timers.target
● │ └─systemd-tmpfiles-clean.timer
● └─network-online.target
● └─NetworkManager-wait-online.service
Atualizar
Eu adicionei a parte "install", agora funciona
[Unit]
Description=Live555 Media Server
Requires=network-online.target
After=network.target network-online.target local-fs.target
[Service]
Type=simple
Restart=on-failure
ExecStart=/opt/live555/live555MediaServer
WorkingDirectory=/opt/live555
[Install]
WantedBy=default.target