PDA

View Full Version : Bash: Service: command not found



Elliot
15th January 2007, 02:32 AM
Hi,

I am wanting to give non root users the ability to stop and start services on my Fedora Core 5 Box. There is one service called hlsrv i want it to be able to done with, but i do not mind if they can stop and start all services.

At the moment only root can do it. Any help would be great.

jim
15th January 2007, 02:35 AM
try
/sbin/service hisrv start|stop|restart

Elliot
15th January 2007, 02:37 AM
Genious, that works just the treat, thank you very much for the fast reply!

Elliot
15th January 2007, 02:52 AM
Ok i thought it was working, with some users it says password: at the end, and with the users that it does not say that for, the command goes through ok, but the service does not start. Any clues?

bmvbab
15th January 2007, 07:13 AM
Elliot check if you have set up sudo for the users who want to use the service command.

Elliot
15th January 2007, 02:44 PM
Yeah that was the one, i have added a group now and put them in the group and put the group in the sudoers file in /etc/

I have changed a few permissions and made a mess of things now though... let me explain and see if you can help.

Now when i log in on ssh i get:

Could not chdir to home directory /home/servers/cstest: Permission denied
-bash: /home/servers/cstest/.bash_profile: Permission denied
-bash-3.1$

This is for any user that resides in the servers dir. I have even tried adding new accounts in that dir and it just does the sma e for new accounts. Though if i add an account outside the dir it does not do it.

Heres the folder permissions:

[root@localhost ~]# ls -al /home
total 36
drwxrwxrwx 7 root root 4096 Jan 15 14:18 .
drwxr-xr-x 23 root root 4096 Jan 15 02:14 ..
drwx------ 4 bncadmin bncadmin 4096 Oct 11 20:44 bncadmin
drwx------ 2 help help 4096 Jan 15 14:31 help
drwx------ 3 richard_test richard_test 4096 Jan 15 05:11 richard_test
drwxrwx--- 9 root root 4096 Jan 15 14:16 servers
drwx------ 3 teamspeak teamspeak 4096 Oct 9 21:32 teamspeak


[root@localhost ~]# ls -al /home/servers
total 60
drwxrwx--- 9 root root 4096 Jan 15 14:16 .
drwxrwxrwx 7 root root 4096 Jan 15 14:18 ..
-rwxrwx--- 1 root root 3235 Jan 15 13:42 .bash_history
-rwxrwx--- 1 root root 24 Sep 8 10:34 .bash_logout
-rwxrwx--- 1 root root 191 Sep 8 10:34 .bash_profile
-rwxrwx--- 1 root root 124 Sep 8 10:34 .bashrc
drwxrwx--- 6 root root 4096 Nov 9 02:03 control
drwxrwx--- 2 cstest cstest 4096 Jan 15 14:14 cstest
drwxrwx--- 5 glhf auth 4096 Jan 7 17:06 glhf
drwxrwx--- 4 psp auth 4096 Jan 1 20:45 psp
drwxrwx--- 4 richard auth 4096 Jan 15 03:51 richard
drwxrwx--- 2 root root 4096 Jan 15 13:45 .steam
drwxrwx--- 2 test test 4096 Jan 15 14:16 test
-rwxrwx--- 1 root root 595 Jan 15 04:40 .viminfo