0

I want run live555MediaServer as a daemon on CentOS 7. I create following startup script.

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

And enable the service

systemctl enable live555

But the media server is never started after boot, i can start it manual without problems.

Status after boot:

[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)

systemctl list-dependencies 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
● │ ├─selinux-policy-migrate-local-changes@targeted.service
● │ ├─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

Update

I have add the "install" part, now it works

[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
  • Make sure that you enable the service as well with "systemctl enable live555" This will cause it to run on boot – Raman Sailopal Oct 2 '17 at 11:10
  • i have enable the service, but i have copy the wrong command to my question. – live2 Oct 2 '17 at 11:12
  • 1
    Don't you need an explicit [Install] WantedBy=? If it's not wanted by the target, it probably won't get started. – Ulrich Schwarz Oct 2 '17 at 11:27
  • Also, does this service rely on a GUI session? – Raman Sailopal Oct 2 '17 at 11:32
  • @raman the service print on start to the console – live2 Oct 2 '17 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.