デーモンサービス の作成

/opt/hello.sh

#!/bin/bash
#
#	hello.sh
#
while true
do
	echo hello world >> /tmp/hello.log
	date >> /tmp/hello.log
	sleep 1
done
		
/etc/systemd/system/hello.service

[Unit]
Description = hello daemon

[Service]
ExecStart = /opt/hello.sh
Restart = always
Type = simple

[Install]
WantedBy = multi-user.target
		
起動
# systemctl start hello

Return

Jun/29/2015 AM 08:15