[問題] non root呼叫/etc/init.d/裡的script

看板Linux作者 (嘻嘻)時間9年前 (2015/05/31 09:56), 編輯推噓0(005)
留言5則, 3人參與, 最新討論串1/2 (看更多)
請問一下前輩們 我目前用的作業環境是CentOS 而它會跟另一台window的軟體進行溝通 而window那邊會時常出現no connection be made with the daemon之類的訊息 此時我都必須在我CentOS端登入root然後/etc/init.d/abc restart (假裝script是叫abc) 或者/etc/init.d/abc stop→ /etc/init.d/abc start 請問如果要建個script並且可以完成上述的動作在不用登入root的情況下該怎麼做 還是有其它更方便的方法? 爬文有看到service abc restart 或者SuSE系列的使用rcapache2 restart 似乎也要root 謝謝 -- -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 218.173.166.125 ※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1433037366.A.FDD.html

05/31 10:24, , 1F
放一個restart專用的user+sudoer?
05/31 10:24, 1F

05/31 13:01, , 2F
希望開機就執行的放
05/31 13:01, 2F

05/31 13:01, , 3F
/etc/rc.d/rc.local
05/31 13:01, 3F

05/31 16:40, , 4F
他要restart
05/31 16:40, 4F

06/02 21:25, , 5F
謝謝一樓 已成功 我用visudo去設訂
06/02 21:25, 5F
文章代碼(AID): #1LQces_T (Linux)
文章代碼(AID): #1LQces_T (Linux)