0

I have a hard link to a service script in /etc/init.d/ that points to a shell script (bash). The permissions show owner, user and group permissions to be rwx for everyone.

However, when I run the $find /etc/init.d/ -group myuser command, nothing in the directory shows up for myuser, even though it appears anyone can execute the script. I double checked and when I run $find /etc/init.d/ -group root, the output shows the permissions for root just fine.

Any ideas what's going on? When I execute the service it appears to run fine (it's supposed to shut down some processes by pid), however when I ps -ef the processes, they are still running.

Baffling...

jim
  • 3
  • 1

1 Answers1

1

Because the script contains commands that are privileged e.g. kill or initctl.

If the service is running as root then only a user with root privileges can kill it even though you have a script with world execute permissions that contains those commands. Have a look at the shell script that you are mentioning and see what commands it contains.

The right way to call your init script is with sudo.

hookenz
  • 14,472
  • 23
  • 88
  • 143
  • Yep. The pid file was being accessed by the script and the permissions were set wrong. Nicely done, Matt. – jim Mar 27 '14 at 14:37
  • Glad you now have it working. Can you please accept my answer by clicking on the big tick to the right. That way others who come across the same thing know it's right. – hookenz Mar 27 '14 at 19:42