Setting up a systemd service to loop videos using VLC on a Raspberry Pi - linux

I have a Raspberry Pi 4 that I'm using inside a display case to play some mp4 videos on loop. While normally I might simply open VLC using the desktop GUI, load them, hit play and maximize to fullscreen, I want this to be a bit more robust and capable of restarting itself. Also, I will note, for an undiagnosed reason, the above has resulted in video stoppage when I tried it.
What I've tried is to follow these instructions, but I would really appreciate some help to troubleshoot where I may be going wrong: https://gist.github.com/anthonyray/bb6fd7363cd99204330f17c54513f293
My videokiosk.service file looks like this:
[Unit]
Description=videokiosk
[Service]
User=kioskman
Environment="DISPLAY=:0"
ExecStart=/usr/bin/vlc -Rf pastels.mp4
WorkingDirectory=/home/sean/Videos
Restart=always
[Install]
WantedBy=multi-user.target
Its status after loading and trying to run it was:
● videokiosk.service - videokiosk
Loaded: loaded (/etc/systemd/system/videokiosk.service; enabled; vendor preset: enabled)
Active: failed (Result: start-limit-hit) since Fri 2022-07-22 10:47:52 EDT; 3min 56s ago
Process: 885 ExecStart=/usr/bin/vlc -Rf pastels.mp4 (code=exited, status=0/SUCCESS)
Main PID: 885 (code=exited, status=0/SUCCESS)
CPU: 430ms
Jul 22 10:47:52 raspberrypi systemd[1]: videokiosk.service: Scheduled restart job, restart counter is at 5.
Jul 22 10:47:52 raspberrypi systemd[1]: Stopped videokiosk.
Jul 22 10:47:52 raspberrypi systemd[1]: videokiosk.service: Start request repeated too quickly.
Jul 22 10:47:52 raspberrypi systemd[1]: videokiosk.service: Failed with result 'start-limit-hit'.
Jul 22 10:47:52 raspberrypi systemd[1]: Failed to start videokiosk.
The journal looks like this:
-- Journal begins at Mon 2022-04-04 08:44:56 EDT. --
Jul 22 10:47:52 raspberrypi vlc[885]: > Shutting down.
Jul 22 10:47:52 raspberrypi vlc[885]: [00486638] [cli] lua interface: Requested shutdown.
Jul 22 10:47:52 raspberrypi vlc[885]: [afc0d578] cache_read stream error: cannot pre fill buffer
Jul 22 10:47:52 raspberrypi vlc[885]: [afc0e188] mjpeg demux error: cannot peek
Jul 22 10:47:52 raspberrypi systemd[1]: videokiosk.service: Succeeded.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit videokiosk.service has successfully entered the 'dead' state.
Jul 22 10:47:52 raspberrypi systemd[1]: videokiosk.service: Scheduled restart job, restart counter is at 5.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ Automatic restarting of the unit videokiosk.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Jul 22 10:47:52 raspberrypi systemd[1]: Stopped videokiosk.
░░ Subject: A stop job for unit videokiosk.service has finished
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A stop job for unit videokiosk.service has finished.
░░
░░ The job identifier is 1446 and the job result is done.
Jul 22 10:47:52 raspberrypi systemd[1]: videokiosk.service: Start request repeated too quickly.
Jul 22 10:47:52 raspberrypi systemd[1]: videokiosk.service: Failed with result 'start-limit-hit'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit videokiosk.service has entered the 'failed' state with result 'start-limit-hit'.
Jul 22 10:47:52 raspberrypi systemd[1]: Failed to start videokiosk.
░░ Subject: A start job for unit videokiosk.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit videokiosk.service has finished with a failure.
░░
░░ The job identifier is 1446 and the job result is failed.
Thank you for your time and thoughts.

Here is what has worked: Changing the WantedBy field to graphical.target; granting permission to the directory holding the videos to the service user.
Thanks to #MarkSetchell for asking the right questions.

Related

Error installing docker on Arch Linux: error initializing graphdriver: loopback attach failed

So I stupidly got a laptop with the latest and greatest hardware, so I had to install ArchLinux (version 5.19.13-arch1-1) instead of debian. I'm only vaguely familiar with linux, my fiance has been helping but this has him stumped too so here we are.
I followed the wiki instructions for installing docker, but consistently get the following error when attempting to start the service:
sudo journalctl --since "5 minutes ago" -xeu docker.service
Oct 26 14:37:34 werk systemd[1]: docker.service: Start request repeated too quickly.
Oct 26 14:37:34 werk systemd[1]: docker.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit docker.service has entered the 'failed' state with result 'exit-code'.
Oct 26 14:37:34 werk systemd[1]: Failed to start Docker Application Container Engine.
░░ Subject: A start job for unit docker.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit docker.service has finished with a failure.
░░
░░ The job identifier is 10988 and the job result is failed.
lines 334-369/369 (END)
sudo journalctl --since "5 minutes ago" -ru docker.service
Oct 26 14:37:34 werk systemd[1]: Failed to start Docker Application Container Engine.
Oct 26 14:37:34 werk systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 26 14:37:34 werk systemd[1]: docker.service: Start request repeated too quickly.
Oct 26 14:37:34 werk systemd[1]: Stopped Docker Application Container Engine.
Oct 26 14:37:34 werk systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Oct 26 14:37:34 werk systemd[1]: Failed to start Docker Application Container Engine.
Oct 26 14:37:34 werk systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 26 14:37:34 werk systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 14:37:34 werk dockerd[71427]: failed to start daemon: error initializing graphdriver: loopback attach failed
I don't really understand loopback devices, but the result of losetup -f seemed sus:
losetup -f
losetup: cannot find an unused loop device: Permission denied
[me#werk ~]$ sudo losetup -f
losetup: cannot find an unused loop device: No such device
We also theorized that the docker user didn't have sufficient permissions to do what it needed to do, but could not find any user specified in the docker.service file (located at /etc/systemd/system/multi-user.target.wants/docker.service). We tried to run the ExecStart command line specified in the docker.service file as root, but got the following error:
[me#werk ~]$ sudo /usr/bin/dockerd -H fd://
[sudo] password for me:
INFO[2022-10-26T14:56:00.483059782-06:00] Starting up
failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd
So that was a bit of a bust.
To be extra clear, installation was as follows:
pacman -Syu docker
systemctl enable docker.service
systemctl start docker.service
And in case it matters, I'm on a Framework laptop with 12th gen Intel core processors.

How to add MACs and KEX algorithms in /etc/ssh/sshd_config on Ubuntu 18.04 on GCP

I added following MACs to /etc/ssh/sshd_config of Ubuntu 18.04 compute instance on GCP. But after updating the file ssh is not restarting and journalctl -xe shows /etc/ssh/sshd_config line 130: Bad SSH2 mac spec.
MACs hmac-sha1-512-etm#openssh.com,hmac-sha1-512-etm#openssh.com,umac-128-etm#openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128#openssh.com
I see following error when I try to restart ssh:
$ sudo systemctl restart ssh
Job for ssh.service failed because the control process exited with error code.
See "systemctl status ssh.service" and "journalctl -xe" for details.
$ journalctl -xe
--
-- Unit ssh.service has begun starting up.
Aug 02 11:37:17 ubuntu1804 sshd[23779]: /etc/ssh/sshd_config line 130: Bad SSH2 mac spec 'hmac-sha1-512-etm#openssh.com,hmac-sha1-512-etm#openssh.com,umac-128-etm#open
Aug 02 11:37:17 ubuntu1804 systemd[1]: ssh.service: Control process exited, code=exited status=255
Aug 02 11:37:17 ubuntu1804 systemd[1]: ssh.service: Failed with result 'exit-code'.
Aug 02 11:37:17 ubuntu1804 systemd[1]: Failed to start OpenBSD Secure Shell server.
-- Subject: Unit ssh.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit ssh.service has failed.
--
-- The result is RESULT.
Aug 02 11:37:17 ubuntu1804 systemd[1]: ssh.service: Service hold-off time over, scheduling restart.
Aug 02 11:37:17 ubuntu1804 systemd[1]: ssh.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit ssh.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Aug 02 11:37:17 ubuntu1804 systemd[1]: Stopped OpenBSD Secure Shell server.
-- Subject: Unit ssh.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit ssh.service has finished shutting down.
Aug 02 11:37:17 ubuntu1804 systemd[1]: ssh.service: Start request repeated too quickly.
Aug 02 11:37:17 ubuntu1804 systemd[1]: ssh.service: Failed with result 'exit-code'.
Aug 02 11:37:17 ubuntu1804 systemd[1]: Failed to start OpenBSD Secure Shell server.
-- Subject: Unit ssh.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit ssh.service has failed.
--
-- The result is RESULT.
Following is the error received when I try to connect after logoff from the existing ssh session.
ubuntu1804> gcloud compute ssh ubuntu1804 --zone us-east1-b
ssh: connect to host 35.237.57.183 port 22: Connection refused
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].
I did not find a single clue about this in google cloud documentation. I can fix the server but I would like to know what is the right way to add such configuration in sshd_config on a Ubuntu linux on GCP.
Verify acceptable values for MACs with ssh -Q mac. I'd assume hmac-sha1-512-etm#openssh.com and hmac-sha1-512-etm#openssh.com won't be there.

Docker.Service Failing to Start on Manjaro XFCE Linux

I'm having problems getting docker to run on Manjaro XFCE.
I've installed it with:
sudo pacman -Syu
sudo pacman -S docker
And attempted to run it with:
sudo systemctl start docker.service
But it is failing with this error:
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
and this is the log I get with systemctl status docker.service:
[nimbi#nimbi-manjaro ~]$ systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2020-10-29 01:31:09 MST; 14min ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Process: 14837 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 14837 (code=exited, status=1/FAILURE)
Oct 29 01:31:09 nimbi-manjaro systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: Stopped Docker Application Container Engine.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: docker.service: Start request repeated too quickly.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: Failed to start Docker Application Container Engine.
journalctl -xe shows this:
░░ The job identifier is 4697.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: docker.service: Start request repeated too quickly.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: docker.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░
░░ The unit docker.service has entered the 'failed' state with result 'exit-code'.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: Failed to start Docker Application Container Engine.
░░ Subject: A start job for unit docker.service has failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░
░░ A start job for unit docker.service has finished with a failure.
░░
░░ The job identifier is 4631 and the job result is failed.
Oct 29 01:31:09 nimbi-manjaro systemd[1]: docker.socket: Failed with result 'service-start-limit-hit'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://forum.manjaro.org/c/support
░░
░░ The unit docker.socket has entered the 'failed' state with result 'service-start-limit-hit'.
lines 1990-2012/2012 (END)
Attempting to run it manually responds with:
[nimbi#nimbi-manjaro ~]$ /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
INFO[2020-10-29T01:53:00.526035448-07:00] Starting up
dockerd needs to be started with root. To see how to run dockerd in rootless mode with unprivileged user, see the documentation
[nimbi#nimbi-manjaro ~]$ sudo /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
INFO[2020-10-29T01:53:08.550576442-07:00] Starting up
failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd
Anyone know how to fix this?
I've also attempted reinstalling via the AUR package but I get the exact same problem.
I'm on Manjaro XFCE 20.1.2 if it helps.
---EDIT---
I think I figured it out...
I had to use sudo systemctl enable docker.service and then type reboot to let it auto start itself.
It is running now.
Here is my current systemctl status docker.service command output:
[nimbi#nimbi-manjaro ~]$ systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor p>
Active: active (running) since Thu 2020-10-29 02:09:12 MST; 3min 10s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 946 (dockerd)
Tasks: 15
Memory: 72.9M
CGroup: /system.slice/docker.service
└─946 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/cont>
Oct 29 02:09:10 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:10.29207978>
Oct 29 02:09:10 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:10.29210347>
Oct 29 02:09:10 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:10.36927019>
Oct 29 02:09:11 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:11.20664981>
Oct 29 02:09:11 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:11.50144324>
Oct 29 02:09:11 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:11.96303711>
Oct 29 02:09:11 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:11.96351080>
Oct 29 02:09:11 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:11.97714186>
Oct 29 02:09:12 nimbi-manjaro dockerd[946]: time="2020-10-29T02:09:12.58058471>
Oct 29 02:09:12 nimbi-manjaro systemd[1]: Started Docker Application Container

Docker start failed in centos 7

Docker service running on Centos 7 failed to start, I have some docker images which I want to save at any cost. I have searched a couple of online docs and they all say to delete /var/lib/docker/ dir which I don't want to because all the images and containers stuff is there. Can someone please save me how to get docker back up and running with losing any data.
Log:
[root#BuyPandGDev01 /]# systemctl status docker.service -l
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2018-04-22 00:05:23 UTC; 19min ago
Docs: http://docs.docker.com
Process: 1539 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES (code=exited, status=1/FAILURE)
Main PID: 1539 (code=exited, status=1/FAILURE)
Apr 22 00:05:22 BuyPandGDev01 systemd[1]: Starting Docker Application Container Engine...
Apr 22 00:05:22 BuyPandGDev01 dockerd-current[1539]: time="2018-04-22T00:05:22.068920976Z" level=info msg="libcontainerd: new containerd process, pid: 1550"
Apr 22 00:05:23 BuyPandGDev01 dockerd-current[1539]: time="2018-04-22T00:05:23.101036303Z" level=warning msg="devmapper: Usage of loopback devices is strongly discouraged for production use. Please use `--storage-opt dm.thinpooldev` or use `man docker` to refer to dm.thinpooldev section."
Apr 22 00:05:23 BuyPandGDev01 dockerd-current[1539]: time="2018-04-22T00:05:23.155223108Z" level=error msg="[graphdriver] prior storage driver \"devicemapper\" failed: devmapper: Base Device UUID and Filesystem verification failed: devicemapper: Error running deviceCreate (ActivateDevice) dm_task_run failed"
Apr 22 00:05:23 BuyPandGDev01 dockerd-current[1539]: time="2018-04-22T00:05:23.155708413Z" level=fatal msg="Error starting daemon: error initializing graphdriver: devmapper: Base Device UUID and Filesystem verification failed: devicemapper: Error running deviceCreate (ActivateDevice) dm_task_run failed"
Apr 22 00:05:23 BuyPandGDev01 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Apr 22 00:05:23 BuyPandGDev01 systemd[1]: Failed to start Docker Application Container Engine.
Apr 22 00:05:23 BuyPandGDev01 systemd[1]: Unit docker.service entered failed state.
Apr 22 00:05:23 BuyPandGDev01 systemd[1]: docker.service failed.
journalctl -xe:
[root#BuyPandGDev01 /]# journalctl -xe
-- Unit docker-storage-setup.service has begun starting up.
Apr 22 00:25:58 BuyPandGDev01 container-storage-setup[2111]: INFO: Volume group backing root filesystem could not be determined
Apr 22 00:25:58 BuyPandGDev01 container-storage-setup[2111]: ERROR: No valid volume group found. Exiting.
Apr 22 00:25:58 BuyPandGDev01 systemd[1]: docker-storage-setup.service: main process exited, code=exited, status=1/FAILURE
Apr 22 00:25:58 BuyPandGDev01 systemd[1]: Failed to start Docker Storage Setup.
-- Subject: Unit docker-storage-setup.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker-storage-setup.service has failed.
--
-- The result is failed.
Apr 22 00:25:58 BuyPandGDev01 systemd[1]: Unit docker-storage-setup.service entered failed state.
Apr 22 00:25:58 BuyPandGDev01 systemd[1]: docker-storage-setup.service failed.
Apr 22 00:25:58 BuyPandGDev01 systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has begun starting up.
Apr 22 00:25:58 BuyPandGDev01 dockerd-current[2140]: time="2018-04-22T00:25:58.731142431Z" level=info msg="libcontainerd: new containe
Apr 22 00:25:59 BuyPandGDev01 dockerd-current[2140]: time="2018-04-22T00:25:59.767061431Z" level=warning msg="devmapper: Usage of loop
Apr 22 00:25:59 BuyPandGDev01 kernel: device-mapper: table: 253:1: thin: Couldn't open thin internal device
Apr 22 00:25:59 BuyPandGDev01 kernel: device-mapper: ioctl: error adding target to table
Apr 22 00:25:59 BuyPandGDev01 dockerd-current[2140]: time="2018-04-22T00:25:59.835261589Z" level=error msg="[graphdriver] prior storag
Apr 22 00:25:59 BuyPandGDev01 dockerd-current[2140]: time="2018-04-22T00:25:59.835697590Z" level=fatal msg="Error starting daemon: err
Apr 22 00:25:59 BuyPandGDev01 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Apr 22 00:25:59 BuyPandGDev01 systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Apr 22 00:25:59 BuyPandGDev01 systemd[1]: Unit docker.service entered failed state.
Apr 22 00:25:59 BuyPandGDev01 systemd[1]: docker.service failed.
Apr 22 00:25:59 BuyPandGDev01 polkitd[703]: Unregistered Authentication Agent for unix-process:2105:147803 (system bus name :1.43, obj
lines 2751-2788/2788 (END)
Any response would be helpful and appreciated.
Thx,
kumar
This error occurred for me when I was upgrading docker. Solution that worked for me was to remove legacy docker files /var/lib/docker/ and restart the docker service. Here is the solution.
# Remove docker files
$ rm -rf /var/lib/docker/
# Restart docker via service or via systemctl
$ service docker restart
$ service docker status
$ systemctl start docker.service
$ systemctl status docker.service
I had this error also starting the docker service:
kernel: device-mapper: table: 253:1: thin: Couldn't open thin internal device
I fixed it by creating a soft link from /var/lib/docker to another location on the machine which had more disk space.
cd /var/lib/
mv docker docker.old
ln -s /path/to/big/disk/docker/ docker
Restart the service:
systemctl restart docker

How to port an RPM package consist of SysV init script to systemd?

I have created an RPM package for my daemon which on installation create service init script under /etc/init.d/
Now I wanted to port this RPM package for CentOS7.1 and use systemd framework for service startup through boot as well as by admin through start/stop command.
I couldn't find any tutorial. Please help.
EDIT:
I tried the suggestion given by msuchy.
I tried and here is my observation
On sysV based framework (CentOS6.5)
[root#adil work]# /etc/init.d/daemon_script status
Service daemon: Stopped
[root#adil work]# /etc/init.d/daemon_script start
Starting daemon: Initializing daemon... [ OK ]
[root#adil work]#
[root#adil work]# /etc/init.d/daemon_script status
Service daemon: Running
[root#adil work]#
[root#adil work]# /etc/init.d/daemon_script stop
Shutting down parent daemon: [ OK ]
[root#adil work]# /etc/init.d/daemon_script status
Service daemon: Stopped
[root#adil work]#
===========
On systemd based framework, I install the same RPM on CentOS7.1
[root#localhost x86_64]# /etc/init.d/daemon_script
Usage: /etc/init.d/daemon_script {start|stop|restart|status}
[root#localhost x86_64]# /etc/init.d/daemon_script start
Starting daemon_script (via systemctl): Warning: Unit file of daemon_script.service changed on disk, 'systemctl daemon-reload' recommended.
Job for daemon_script.service failed. See 'systemctl status daemon_script.service' and 'journalctl -xn' for details.
[FAILED]
[root#localhost x86_64]# systemctl daemon-reload
[root#localhost x86_64]# systemctl status daemon_script.service
daemon_script.service - SYSV: start and stop Test daemon service.
Loaded: loaded (/etc/rc.d/init.d/daemon_script)
Active: failed (Result: exit-code) since Fri 2015-09-11 15:30:44 IST; 32s ago
Sep 11 15:30:44 localhost.localdomain systemd[1]: Starting SYSV: start and st...
Sep 11 15:30:44 localhost.localdomain systemd[1]: daemon_script.service: cont...
Sep 11 15:30:44 localhost.localdomain systemd[1]: Failed to start SYSV: start...
Sep 11 15:30:44 localhost.localdomain systemd[1]: Unit daemon_script.service ...
Hint: Some lines were ellipsized, use -l to show in full.
[root#localhost x86_64]# systemctl status daemon_script.service -l
daemon_script.service - SYSV: start and stop Test daemon service.
Loaded: loaded (/etc/rc.d/init.d/daemon_script)
Active: failed (Result: exit-code) since Fri 2015-09-11 15:30:44 IST; 46s ago
Sep 11 15:30:44 localhost.localdomain systemd[1]: Starting SYSV: start and stop Test daemon service....
Sep 11 15:30:44 localhost.localdomain systemd[1]: daemon_script.service: control process exited, code=exited status=203
Sep 11 15:30:44 localhost.localdomain systemd[1]: Failed to start SYSV: start and stop Test daemon service..
Sep 11 15:30:44 localhost.localdomain systemd[1]: Unit daemon_script.service entered failed state.
[root#localhost x86_64]#
output of journalctl -xn
-- Logs begin at Fri 2015-09-11 14:50:35 IST, end at Fri 2015-09-11 15:40:01 IST. --
Sep 11 15:31:03 localhost.localdomain systemd[1]: [/usr/lib/systemd/system/dm-event.socket:10] Unknown lvalue 'RemoveOnStop' in section 'Socket'
Sep 11 15:39:33 localhost.localdomain systemd[1]: Starting SYSV: start and stop Test daemon service....
-- Subject: Unit daemon_script.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit daemon_script.service has begun starting up.
Sep 11 15:39:33 localhost.localdomain systemd[8509]: Failed at step EXEC spawning /etc/rc.d/init.d/daemon_script: Exec format error
-- Subject: Process /etc/rc.d/init.d/daemon_script could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The process /etc/rc.d/init.d/daemon_script could not be executed and failed.
--
-- The error number returned while executing this process is 8.
Sep 11 15:39:33 localhost.localdomain systemd[1]: daemon_script.service: control process exited, code=exited status=203
Sep 11 15:39:33 localhost.localdomain systemd[1]: Failed to start SYSV: start and stop Test daemon service..
-- Subject: Unit daemon_script.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit daemon_script.service has failed.
--
-- The result is failed.
Sep 11 15:39:33 localhost.localdomain systemd[1]: Unit daemon_script.service entered failed state.
Sep 11 15:40:01 localhost.localdomain systemd[1]: Created slice user-0.slice.
-- Subject: Unit user-0.slice has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit user-0.slice has finished starting up.
--
-- The start-up result is done.
Sep 11 15:40:01 localhost.localdomain systemd[1]: Starting Session 7 of user root.
-- Subject: Unit session-7.scope has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-7.scope has begun starting up.
Sep 11 15:40:01 localhost.localdomain systemd[1]: Started Session 7 of user root.
-- Subject: Unit session-7.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-7.scope has finished starting up.
--
-- The start-up result is done.
Sep 11 15:40:01 localhost.localdomain CROND[8528]: (root) CMD (/usr/lib64/sa/sa1 1 1)
[root#localhost x86_64]#
You do not need to migrate your scripts.
It is probably better and you can utilize some interesting functions of Systemd, your files will be smaller. But you do not need to migrate. Systemd works correctly with SysV init files too.
You can not locate any SysV init files on CentOS 7 installation because Red Hat packagers (who created CentOS) put an effort into packaging and migrated all SysV files to unit files. But you do not need to.
The is only one task you need to do. Once you place new SysV file, you must reload the systemd manager configuration using
# systemctl daemon-reload
That is all.
I give you small example
# cat /etc/init.d/foo
#!/usr/bin/sh
echo ahoy
# chmod a+x /etc/init.d/foo
# systemctl start foo
Failed to start foo.service: Unit foo.service failed to load: No such file or directory.
# systemctl daemon-reload
# systemctl start foo
# journalctl -xn
-- Subject: Unit foo.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit foo.service has finished starting up.
--
-- The start-up result is done.
# service foo start
ahoy
So you can use all command (chkconfig, service) as you are used to from CentOS 6. And when you have time, you can study man systemd.unit(5) and bunch of other man pages (see "SEE ALSO" of that man page).

Resources