
コンピュータの起動時にスクリプトを root として実行したいです。以前は rc.local で実行されていましたが、現在は実行できません。
私が試したこと:
- スクリプトを入れる
/etc/profile.d
- 追加
/pathto/script.sh
する/etc/profile
- 追加され
/pathto/script.sh &
た/etc/xdg/openbox/autostart
このスクリプトは、PowerTop が推奨する設定を行うためのもので、 を実行するとスクリプトは正常に動作しますsudo /pathto/script.sh
。
答え1
これをcrontabに次のように入れることもできます
@reboot /pathto/script.sh