Skip to content

Commit

Permalink
MDEV-7368 : SLES: Failed to start mysql.service: Unit
Browse files Browse the repository at this point in the history
            mysql.service failed to load

Added 'systemctl daemon-reload' command in postin and
postun rpm scripts.
  • Loading branch information
Nirbhay Choubey committed Jan 14, 2015
1 parent 5900333 commit d9d9940
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 24 deletions.
53 changes: 29 additions & 24 deletions support-files/rpm/server-postin.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

# Make MySQL start/shutdown automatically when the machine does it.
if [ $1 = 1 ] ; then
if [ -x /usr/bin/systemctl ] ; then
/usr/bin/systemctl daemon-reload >/dev/null 2>&1
fi

if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --add mysql
fi
Expand Down Expand Up @@ -51,30 +55,31 @@ fi
SETARGETDIR=/etc/selinux/targeted/src/policy
SEDOMPROG=$SETARGETDIR/domains/program
SECONPROG=$SETARGETDIR/file_contexts/program
if [ -f /etc/redhat-release ] \
&& grep -q "Red Hat Enterprise Linux .. release 4" /etc/redhat-release \
|| grep -q "CentOS release 4" /etc/redhat-release ; then
echo
echo
echo 'Notes regarding SELinux on this platform:'
echo '========================================='
echo
echo 'The default policy might cause server startup to fail because it is '
echo 'not allowed to access critical files. In this case, please update '
echo 'your installation. '
echo
echo 'The default policy might also cause inavailability of SSL related '
echo 'features because the server is not allowed to access /dev/random '
echo 'and /dev/urandom. If this is a problem, please do the following: '
echo
echo ' 1) install selinux-policy-targeted-sources from your OS vendor'
echo ' 2) add the following two lines to '$SEDOMPROG/mysqld.te':'
echo ' allow mysqld_t random_device_t:chr_file read;'
echo ' allow mysqld_t urandom_device_t:chr_file read;'
echo ' 3) cd to '$SETARGETDIR' and issue the following command:'
echo ' make load'
echo
echo
if [ -f /etc/redhat-release ] ; then
if grep '\(Red Hat Enterprise Linux ..\|CentOS\) release 4' \
/etc/redhat-release >/dev/null 2>&1; then
echo
echo
echo 'Notes regarding SELinux on this platform:'
echo '========================================='
echo
echo 'The default policy might cause server startup to fail because it is '
echo 'not allowed to access critical files. In this case, please update '
echo 'your installation. '
echo
echo 'The default policy might also cause inavailability of SSL related '
echo 'features because the server is not allowed to access /dev/random '
echo 'and /dev/urandom. If this is a problem, please do the following: '
echo
echo ' 1) install selinux-policy-targeted-sources from your OS vendor'
echo ' 2) add the following two lines to '$SEDOMPROG/mysqld.te':'
echo ' allow mysqld_t random_device_t:chr_file read;'
echo ' allow mysqld_t urandom_device_t:chr_file read;'
echo ' 3) cd to '$SETARGETDIR' and issue the following command:'
echo ' make load'
echo
echo
fi
fi

if [ -x sbin/restorecon ] ; then
Expand Down
7 changes: 7 additions & 0 deletions support-files/rpm/server-postun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ if [ $1 -ge 1 ]; then
fi
fi
fi

if [ $1 = 0 ] ; then
if [ -x /usr/bin/systemctl ] ; then
/usr/bin/systemctl daemon-reload > /dev/null 2>&1
fi
fi

0 comments on commit d9d9940

Please sign in to comment.