#!/bin/sh predown() { echo "" echo "Stoppo apache..." httpd -k stop sleep 1 echo "Stoppo mysqld (pid: $mysqld_pid)..." kill $mysqld_pid echo "Stoppo sshd (pid: $sshd_pid)..." kill $sshd_pid exit 0 } trap 'predown' HUP INT QUIT TERM echo "Lancio sshd..." /usr/sbin/sshd -D & sshd_pid=$! echo "Lancio mysqld..." /usr/bin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mariadb/plugin --user=mysql --log-error=/var/lib/mysql/mysql.err --pid-file=mysql.pid &> /dev/null & mysqld_pid=$! echo "Lancio apache..." httpd -k start wait $!