Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

There is a command inside my

/etc/rc.d/rc.local

i am not sure why it is not being executed.

i think i either need to add #!bash or something on top of the script
or perhaps i need to add gnome-terminal infront of the line being executed.

but is there a way to find out what the error is?

this is the command by the way:

/usr/X11R6/bin/xautolock -time 1 -locker "/root/shut_off"

works fine via terminal.

share|improve this question
    
Not #!bash. Look up shebang. Summarised, if you have an executable script which needs bash to interpreted it then the first line should be either point to the interpreter (e.g. #!/usr/local/bin/bash) or #!/usr/bin/env bash. The latter is more portable. –  Hennes Sep 1 '13 at 19:00

1 Answer 1

up vote 1 down vote accepted

You are adding a command that relies on a running X server to a file that is run before the X server has been initialized and will, in any case, not be run by the user who started the server but by root.

What is it you want to do? If you just want that command to be run every time you log in for example, add it to your ~/.profile (or ~/.bash_profile if that file exists and you are using bash).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.