/etc/init.d/script.sh permission denied for normal user?
I have a script in /etc/init.d (some distros call it /etc/rc.d) where all the other scripts for the runlevels reside. (It minimizes power consumption on a netbook). It gets started during boot all right.
Since not all devices / processes / whatever are up and running I also want to run the script when entering runlevel 5. So I have a link in /home/user/.kde4/Autostart to the original file in /etc/init.d. When I run the script via this link I get "permission denied". The link has Code:
lrwxr-xr-x root root The script in /etc/init.d has Code:
-rwxr-xr-x root root The directories /etc and init.d have "drwxr-xr-x". No go. I tried on the script "chmod 1755 script", "chmod 2755 script", "chmod 3755 script", "chmod 5755 script", "chmod 7755 script" -- nothing (as you see, I don't really understand the effects, but I tried). Why doesn't it work? |
Quote:
- If the service should run in runlevel 5 then use your system management tools (or add a slink) to make it start in runlevel 5. - If the service restart depends on device availability then check Udev or whatever your system uses to trigger a response. - If you need the user to run the service anyway then add an entry for the exact command in /etc/sudoers and configure it so the users can execute the exact command though Sudo without it asking for a password for it. - If you want to do the above but in a less DE-dependent way you could try using pam_script in the PAM stack for GDM, KDM or whatever DMs you have. |
Quote:
Quote:
It is not a service in the usual sense but a script which runs just once to minimize power consumption of the system. Quote:
Quote:
Quote:
But ... my original question is not really answered: Why doesn't it work? This is something I'd very much like to understand. |
Quote:
|
....ahhh, I see -- and should have seen earlier. Thanks unSpawn.
The script has tons of write operations on files writeable only to root. While I might change all necessary permissions sequentially by hand, I would also have to keep track of them during system updates. That is too much ado. I'll use sudo when there is no connection to the power grid. Issue solved. Thanks again. P.S.: ...that source to read up on udev triggers? ;) |
Quote:
*If it's about a device connect / disconnect thing maybe post some lsusb / lspci / lshal / ls*whatever specs? Else a verbose description of what's happening. |
Okay, okay, okay ;). "udev trigger" gives plenty of results, I'll learn from them. I thought you had something special in mind.
|
All times are GMT -5. The time now is 07:35 AM. |