1
我在執行某些操作的kali2016.1框中的/etc/init.d中有一個bash腳本。我的問題如下:在執行腳本./script
{start | stop | restart |}時,會在控制檯上顯示echo的輸出。然而,當我將它運行爲service script
{start | stop | restart | *}時,它會將echo輸出記錄在/var/log/daemon.log中。我如何改變這種行爲,以便在作爲服務執行時繼續記錄,並在控制檯上顯示回顯輸出?涵蓋的基本知識如下:在控制檯上顯示init.d腳本回顯
#!/bin/bash
case "$1" in
start)
echo "start"
;;
stop)
echo "stop"
;;
restart)
echo "restart"
;;
*)
echo "usage {start|stop|restart}"
exit 1
;;
esac
exit 0
將其作爲守護進程運行,我使用'update-rc.d腳本默認值' –