Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Mar 2005 13:49:46 -0800 (PST)
From:      John Public <jhnpublic@yahoo.com>
To:        Jeff Wirth <jeff.wirth@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: su command problem
Message-ID:  <20050328214946.5092.qmail@web50110.mail.yahoo.com>
In-Reply-To: 6667

next in thread | raw e-mail | index | archive | help
I'm apologize for being unclear.  Let me try again.  I
have not modified the mysql-server.sh script in any
way.  The 'su -m mysql -c date' line is merely an
example of what I used to see if 'su' is having a
problem.  All that line does is run the 'date' command
as the mysql user.  I used this for testing between
the 5.3 system and the 5.2.1 system to see if there
was a difference.  

Indeed there was a difference.  On the 5.2.1 system
the command ran 'date' w/o any problem and then
returned control to the root shell, but on the 5.3
system, it su'ed me to the mysql account, but did not
execute the 'date' command and stayed w/ the mysql
account.
  
This is how I have come to the conclusion that it has
something to do w/ the su command or security relating
to it, rather than the scripts which are used to run
mysql or nagios.  I guess I'm trying to determine if
this is a bug in the 'su' command or if there is a
security setting somewhere in 5.3 which changes the
behavior of 'su'.

Thanks again for your attention.
John
--- Jeff Wirth <jeff.wirth@gmail.com> wrote:
> >On Mon, 28 Mar 2005 11:03:23 -0800 (PST), John
> Public
> <jhnpublic@yahoo.com> wrote:
> 
> > Thanks for your quick reply.  In answer to your
> query,
> 
> NP
> 
> > yes, I installed mysql 4.1 from ports, and it
> works
> > just fine if I start it using mysqld_safe. 
> However,
> > if  I attempt to run it from
> > /usr/local/etc/rc.d/mysql-server.sh, the same
> behavior
> > occurs.  My reasoning for thinking it is a problem
> w/
> > the su command is as follows:
> > 
> > su -m mysql -c date
> 
> first, I don't think the 'mysql' binary even has a
> '-c' option.
> 
> If I'm following you here, you modify the default
> startup script
> (/usr/local/etc/rc.d/mysql-server.sh) to run `su -m
> mysql -c date`. 
> Instead of the default (w/flags):
> 
> /usr/local/bin/mysqld_safe --user=${mysql_user}
> --datadir=${mysql_dbdir}
> --bind-address=${bind_address}
> --pid-file=${pidfile} > /dev/null &
> 
> why?
> 
> > When I got to digging around in the rc system
> while I
> > was having the same problem w/ nagios, I
> discovered
> > that it is using the su command.  Hope this makes
> > sense.  Once again, thanks for your input and any
> > further insight would be appreciated.
> 
> I would take a look at the default mysql startup
> script and compare it
> to what you currently have in place.
>
(/path/to/ports/database/mysql41-server/files/mysql-server.sh)
> 
> -jw
> 


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search. 
http://info.mail.yahoo.com/mail_250



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050328214946.5092.qmail>