non root呼叫/etc/init.d/裡的script - Linux

Table of Contents

請問一下前輩們

我目前用的作業環境是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

謝謝

--

--

All Comments

Delia avatarDelia2015-06-02
放一個restart專用的user+sudoer?
Hedwig avatarHedwig2015-06-05
希望開機就執行的放
/etc/rc.d/rc.local
Wallis avatarWallis2015-06-08
他要restart
Frederic avatarFrederic2015-06-09
謝謝一樓 已成功 我用visudo去設訂