
컴퓨터가 시작될 때 루트로 스크립트를 실행하고 싶습니다. 이전에는 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