Commit dd02a316aca0c324d7eb79c0b4bb1baa8f2e5f03
1 parent
a8fe7f2d
Exists in
master
and in
23 other branches
Making sure Noosfero starts after a forced reboot
* Store all temporary files in /var * Symlink the directories in /var inside the Noosfero directory * Updated sample ferret configuration * Updates logrotate configuration
Showing
3 changed files
with
39 additions
and
6 deletions
Show diff stats
config/ferret_server.yml.dist
| 1 | production: | 1 | production: |
| 2 | host: localhost | 2 | host: localhost |
| 3 | port: 9011 | 3 | port: 9011 |
| 4 | - pid_file: log/ferret.pid | 4 | + pid_file: tmp/pids/ferret.production.pid |
| 5 | #development: | 5 | #development: |
| 6 | # host: localhost | 6 | # host: localhost |
| 7 | # port: 9010 | 7 | # port: 9010 |
| 8 | -# pid_file: log/ferret.pid | 8 | +# pid_file: tmp/pids/ferret.development.pid |
| 9 | #test: | 9 | #test: |
| 10 | # host: localhost | 10 | # host: localhost |
| 11 | # port: 9009 | 11 | # port: 9009 |
| 12 | -# pid_file: log/ferret.pid | 12 | +# pid_file: tmp/pids/ferret.test.pid |
| 13 | staging: | 13 | staging: |
| 14 | host: localhost | 14 | host: localhost |
| 15 | port: 9011 | 15 | port: 9011 |
| 16 | - pid_file: log/ferret.pid | 16 | + pid_file: tmp/pids/ferret.staging.pid |
etc/init.d/noosfero
| @@ -39,7 +39,7 @@ if [ -z $NOOSFERO_DIR ] || [ -z $NOOSFERO_USER ]; then | @@ -39,7 +39,7 @@ if [ -z $NOOSFERO_DIR ] || [ -z $NOOSFERO_USER ]; then | ||
| 39 | fi | 39 | fi |
| 40 | 40 | ||
| 41 | ###################### | 41 | ###################### |
| 42 | -FERRET_PID_FILE=$NOOSFERO_DIR/log/ferret.pid | 42 | +FERRET_PID_FILE=$NOOSFERO_DIR/tmp/pids/ferret.production.pid |
| 43 | 43 | ||
| 44 | main_script() { | 44 | main_script() { |
| 45 | cd $NOOSFERO_DIR | 45 | cd $NOOSFERO_DIR |
| @@ -58,6 +58,39 @@ do_start() { | @@ -58,6 +58,39 @@ do_start() { | ||
| 58 | exit 2 | 58 | exit 2 |
| 59 | fi | 59 | fi |
| 60 | 60 | ||
| 61 | + # PID directories | ||
| 62 | + if [ ! -d /var/run/noosfero ]; then | ||
| 63 | + mkdir /var/run/noosfero | ||
| 64 | + chown $NOOSFERO_USER:root /var/run/noosfero | ||
| 65 | + chmod 755 /var/run/noosfero | ||
| 66 | + fi | ||
| 67 | + | ||
| 68 | + # Noosfero logs | ||
| 69 | + if [ ! -d /var/log/noosfero ]; then | ||
| 70 | + mkdir /var/log/noosfero | ||
| 71 | + chown $NOOSFERO_USER:root /var/log/noosfero | ||
| 72 | + chmod 750 /var/log/noosfero | ||
| 73 | + fi | ||
| 74 | + | ||
| 75 | + # Noosfero tmp directory | ||
| 76 | + if [ ! -d /var/tmp/noosfero ]; then | ||
| 77 | + mkdir /var/tmp/noosfero | ||
| 78 | + chown $NOOSFERO_USER:root /var/tmp/noosfero | ||
| 79 | + chmod 750 /var/tmp/noosfero | ||
| 80 | + fi | ||
| 81 | + | ||
| 82 | + # symlink the directories into Noosfero directory | ||
| 83 | + if [ ! -e $NOOSFERO_DIR/tmp ]; then | ||
| 84 | + ln -s /var/tmp/noosfero $NOOSFERO_DIR/tmp | ||
| 85 | + fi | ||
| 86 | + if [ ! -e $NOOSFERO_DIR/tmp/pids ]; then | ||
| 87 | + ln -s /var/run/noosfero $NOOSFERO_DIR/tmp/pids | ||
| 88 | + fi | ||
| 89 | + if [ ! -e $NOOSFERO_DIR/log ]; then | ||
| 90 | + ln -s /var/log/noosfero $NOOSFERO_DIR/log | ||
| 91 | + fi | ||
| 92 | + | ||
| 93 | + # actually start the service | ||
| 61 | main_script start | 94 | main_script start |
| 62 | } | 95 | } |
| 63 | 96 |
etc/logrotate.d/noosfero