su command problem

John Public jhnpublic at yahoo.com
Mon Mar 28 13:49:48 PST 2005


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 at gmail.com> wrote:
> >On Mon, 28 Mar 2005 11:03:23 -0800 (PST), John
> Public
> <jhnpublic at 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


More information about the freebsd-questions mailing list