LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   su: /bin/bash: Permission denied (https://www.linuxquestions.org/questions/linux-general-1/su-bin-bash-permission-denied-336245/)

dwarf007 06-22-2005 07:38 PM

su: /bin/bash: Permission denied
 
I am having a problem while i am trying to start a service , i got the below error

Code:

su: /bin/bash: Permission denied
anyone have the idea to fix this, please help
Thank You.......

perfect_circle 06-22-2005 07:40 PM

can you be more specific. What command did you try and created this error?

dwarf007 06-22-2005 07:45 PM

This happen when i am trying to restart a service name call "nagios"

Code:

/etc/rc.d/init/nagios restart
Anyone knows, please help
Thank You.........

perfect_circle 06-22-2005 07:50 PM

Quote:

Originally posted by dwarf007
This happen when i am trying to restart a service name call "nagios"

Code:

/etc/rc.d/init/nagios restart
Anyone knows, please help
Thank You.........

probably the file /etc/rc.d/init/nagios has no execute permissions.
SO try:
Code:

bash /etc/rc.d/init/nagios restart
or
Code:

. /etc/rc.d/init/nagios restart
or give execute permission to the file:
Code:

chmod +x /etc/rc.d/init/nagios
and try your command again.
I would recomment the first 2 options.

*EDIT*
try
Code:

ls -l /etc/rc.d/init/nagios
to see the file permissions.

dwarf007 06-22-2005 07:56 PM

Still cant solve the problem, anyone has idea on it?
Anyway thanks for the help perfect_circle :)

perfect_circle 06-22-2005 08:03 PM

are you root?
you need to be logged in as root to restart a server.
If not type
Code:

su
in the terminal to became root.
What distro are u using?

dwarf007 06-22-2005 08:09 PM

I already login as root, but i dont know why this problem prompt out......
I am using Fedora Core 4

perfect_circle 06-22-2005 09:21 PM

I don't think this is the way to restart a service in fedora. This looks more like the slackware way :) Search your gnome menus. I'm pretty sure there is a utility for this.

moon305 01-20-2006 01:45 PM

/etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/usr/local/sbin/vsftpd&
POSTGRESDIR=/usr/local/pgsql
if [ -x $POSTGRESDIR/bin/postmaster -a -d $POSTGRESDIR/data ];then
rm -f /tmp/.s.PGSQL.5432
su - postgres -c "postmaster -S -i -B 2048"
echo -n 'postmaster'
fi

# reboot the computer display the message
su: /bin/bash: Permission denied
OS : Fedora 4

gilead 01-20-2006 02:22 PM

Do you get the same error when you run the following as root:

Code:

su - postgres -c "/usr/local/pgsql/bin/postmaster -S -i -B 2048"
What happens if you login as postgres and run the following:

Code:

/usr/local/pgsql/bin/postmaster -S -i -B 2048
Is postgres the correct username?

saman007uk 01-20-2006 04:32 PM

In Fedora, you should use the following to restart a command:
Code:

/sbin/service nagios restart


All times are GMT -5. The time now is 05:45 PM.