[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Problem with start-stop-daemon


I do not know if I am on the right mailling list for this problem.

Here the problem with start-stop-daemon.

On my package tango on mentors, I need to start a service.
this one need a connection to mysql.

so I uses dbconfig to generate the /var/lib/tango/.my.cnf mode(600) for
a tango (system) user :
tango:x:114:123:Tango Server,,,:/var/lib/tango:/bin/false

All this is ok after the first installation.

In the /etc/init.d/tango-db I have :

DAEMON = /usr/lib/tango/tango5/database
NAME = tango-db
echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet --chuid tango:tango --background --make-pidfile --pidfile /var/run/$NAME.pid \ 
          --exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."

but when I start the daemon, it try to connect as root and not as tango
user. what is wrong with --chuid.
(the code of the daemon use a NULL identifier for the user in the
mysql_real_connect method so the mysql connection must use the current
user, I check this by starting the daemon from root and from my
personnal account and it works. The first time it tries to connect as
root@localhot and the second times as picca@localhost)

Did I miss something with start-stop-daemon?

thank you and sorry for the noise if it is not the right mailling list.


Ps: even worse

in an xterm

picca@mordor:~$su root
root@mordor:~#invoke-rc.d tango-db start
It tries to connect to mysql as picca@localhost instead of tango@localhost.

in a tty:
after login as root the same invoke-rc.d try to connect as root@localhost.

Reply to: