[root@master ~]# vi /usr/local/bin/hoge.sh [root@master ~]# cat /usr/local/bin/hoge.sh #!/usr/bin/bash while : do logger "test(PID=`echo $$`,Unit=$1)" sleep 30 done [root@master ~]# chmod 744 /usr/local/bin/hoge.sh
なんだかすぐに見つからなかったので、 自分用に書いておく。 実行時のユーザ、グループは、 Serviceセクションに User=ユーザ Group=グループ で指定できる。 [Unit] Description=My Daemon [Service] ExecStart=/myhome/scripts/run.sh ExecStop=/bin/kill ${MAINPID} Restart=always Type=forking User=myuser Group=mygroup [Install] WantedBy=multi-user.target Register as a new user and use Qiita more conveniently You get articles that match your needsYou can efficiently read ba
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く