Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :/etc/init.d$ cat apache2-tmpfs
- #!/bin/bash
- #
- ### BEGIN INIT INFO
- # Provides: apache2-tmpfs
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Required-Start:
- # Required-Stop:
- # Short-Description: Create /var/log/apache2/error.log on tmpfs at startup
- # Description: Create /var/log/apache2/error.log needed by Apache.
- ### END INIT INFO
- #
- # main()
- #
- case "${1:-''}" in
- 'start')
- # create the /var/log/apache2/error.log needed by apache
- mkdir /var/log/apache2
- chmod 755 /var/log/apache2
- chown root:adm /var/log/apache2
- # copy back existing logs
- cp /permanent/apache2/var/log/error.log /var/log/apache2/
- cp /permanent/apache2/var/log/access.log /var/log/apache2/
- #chmod 644 /var/log/apache2/error.log
- #chown root:adm /var/log/apache2/error.log
- ;;
- 'stop')
- # Backup existing logs including all logrotates
- mkdir -p /permanent/apache2/var/log
- cp /var/log/apache2/* /permanent/apache2/var/log/
- ;;
- 'restart')
- ;;
- 'reload'|'force-reload')
- $0 stop
- $0 start
- ;;
- 'status')
- ;;
- *)
- echo "Usage: $SELF start"
- exit 1
- ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement