나는 달리고 싶다live555 미디어 서버CentOS 7의 데몬으로. 다음 시작 스크립트를 만들었습니다.
live555.서비스(/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
서비스를 활성화하고
systemctl enable live555
하지만 부팅 후 미디어 서버가 시작되지 않으므로 문제 없이 수동으로 시작할 수 있습니다.
시작 후 상태:
[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 목록 종속성 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
고쳐 쓰다
"설치" 섹션을 추가했는데 이제 작동합니다.
[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