6

I'm using CentOS 5.5.

I installed the mysql-server RPM from CentOS.org. I believe this RPM was supposed to create a user called 'mysql'. However, this user doesn't exist.

How can I view the contents of an RPM to see if it attempts to create a user or group?

1 Answer 1

10

To view scripts in a RPM run:

rpm -q --scripts $INSTALLEDPACKAGE

To answer your question: yes, mysql-server creates the mysql user.

[user@server CentOS]# rpm -qp --scripts mysql-server-5.0.77-4.el5_4.2.i386.rpm
warning: mysql-server-5.0.77-4.el5_4.2.i386.rpm: V3 DSA signature: NOKEY, key ID e8562897
preinstall scriptlet (using /bin/sh):
/usr/sbin/useradd -M -o -r -d /var/lib/mysql -s /bin/bash \
        -c "MySQL Server" -u 27 mysql > /dev/null 2>&1 || :
postinstall scriptlet (using /bin/sh):
if [ $1 = 1 ]; then
    /sbin/chkconfig --add mysqld
fi
/bin/chmod 0755 /var/lib/mysql
/bin/touch /var/log/mysqld.log
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
    /sbin/chkconfig --del mysqld
fi
postuninstall scriptlet (using /bin/sh):
if [ $1 -ge 1 ]; then
    /sbin/service mysqld condrestart >/dev/null 2>&1 || :
fi
2
  • Thanks. Bonus question: I don't see a line which modifies /etc/group . How can I tell what package added 'mysql' to /etc/group ? Aug 4, 2010 at 17:39
  • 1
    I'll answer my bonus question. If no group is specified, then useradd will create a group by default. From man useradd: "The version provided with Red Hat Linux will create a group for each user added to the system by default" Aug 4, 2010 at 17:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .