瀏覽代碼

gnusocial queuedaemons use www-data

Bob Mottram 8 年之前
父節點
當前提交
86371327cf
共有 3 個檔案被更改,包括 11 行新增11 行删除
  1. 5
    5
      src/freedombone-app-gnusocial
  2. 5
    5
      src/freedombone-app-postactiv
  3. 1
    1
      src/freedombone-utils-gnusocialtools

+ 5
- 5
src/freedombone-app-gnusocial 查看文件

@@ -404,7 +404,7 @@ function restore_local_gnusocial {
404 404
         gnusocial_dir=/var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs
405 405
         # stop the daemons
406 406
         cd $gnusocial_dir
407
-        scripts/stopdaemons.sh
407
+        su -c "sh scripts/stopdaemons.sh" -s /bin/sh www-data
408 408
 
409 409
         function_check gnusocial_create_database
410 410
         gnusocial_create_database
@@ -416,7 +416,7 @@ function restore_local_gnusocial {
416 416
 
417 417
         # start the daemons
418 418
         cd $gnusocial_dir
419
-        scripts/startdaemons.sh
419
+        su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data
420 420
         echo $"Restore of gnusocial complete"
421 421
     fi
422 422
 }
@@ -452,7 +452,7 @@ function restore_remote_gnusocial {
452 452
 
453 453
         # stop the daemons
454 454
         cd /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs
455
-        ./scripts/stopdaemons.sh
455
+        su -c "sh scripts/stopdaemons.sh" -s /bin/sh www-data
456 456
 
457 457
         function_check gnusocial_create_database
458 458
         gnusocial_create_database
@@ -465,7 +465,7 @@ function restore_remote_gnusocial {
465 465
 
466 466
         # start the daemons
467 467
         cd /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs
468
-        ./scripts/startdaemons.sh
468
+        su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data
469 469
         echo $"Restore of gnusocial complete"
470 470
     fi
471 471
 }
@@ -487,7 +487,7 @@ function remove_gnusocial {
487 487
     fi
488 488
     if [ -f /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/scripts/stopdaemons.sh ]; then
489 489
         cd /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/scripts
490
-        ./scripts/stopdaemons.sh
490
+        su -c "sh scripts/stopdaemons.sh" -s /bin/sh www-data
491 491
     fi
492 492
     kill_pid=$(ps aux | grep /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/scripts/queuedaemon.php | awk -F ' ' '{print $2}' | head -n 1)
493 493
     kill -9 $kill_pid

+ 5
- 5
src/freedombone-app-postactiv 查看文件

@@ -411,7 +411,7 @@ function restore_local_postactiv {
411 411
         postactiv_dir=/var/www/${POSTACTIV_DOMAIN_NAME}/htdocs
412 412
         # stop the daemons
413 413
         cd $postactiv_dir
414
-        scripts/stopdaemons.sh
414
+        su -c "sh scripts/stopdaemons.sh" -s /bin/sh www-data
415 415
 
416 416
         function_check postactiv_create_database
417 417
         postactiv_create_database
@@ -423,7 +423,7 @@ function restore_local_postactiv {
423 423
 
424 424
         # start the daemons
425 425
         cd $postactiv_dir
426
-        scripts/startdaemons.sh
426
+        su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data
427 427
     fi
428 428
 }
429 429
 
@@ -455,7 +455,7 @@ function restore_remote_postactiv {
455 455
 
456 456
         # stop the daemons
457 457
         cd /var/www/${POSTACTIV_DOMAIN_NAME}/htdocs
458
-        ./scripts/stopdaemons.sh
458
+        su -c "sh scripts/stopdaemons.sh" -s /bin/sh www-data
459 459
 
460 460
         function_check postactiv_create_database
461 461
         postactiv_create_database
@@ -468,7 +468,7 @@ function restore_remote_postactiv {
468 468
 
469 469
         # start the daemons
470 470
         cd /var/www/${POSTACTIV_DOMAIN_NAME}/htdocs
471
-        ./scripts/startdaemons.sh
471
+        su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data
472 472
     fi
473 473
 }
474 474
 
@@ -489,7 +489,7 @@ function remove_postactiv {
489 489
     fi
490 490
     if [ -f /var/www/$POSTACTIV_DOMAIN_NAME/htdocs/scripts/stopdaemons.sh ]; then
491 491
         cd /var/www/$POSTACTIV_DOMAIN_NAME/htdocs/scripts
492
-        ./scripts/stopdaemons.sh
492
+        su -c "sh scripts/stopdaemons.sh" -s /bin/sh www-data
493 493
     fi
494 494
     kill_pid=$(ps aux | grep /var/www/$POSTACTIV_DOMAIN_NAME/htdocs/scripts/queuedaemon.php | awk -F ' ' '{print $2}' | head -n 1)
495 495
     kill -9 $kill_pid

+ 1
- 1
src/freedombone-utils-gnusocialtools 查看文件

@@ -468,7 +468,7 @@ function gnusocial_hourly_script {
468 468
     echo '    MY_EMAIL_ADDRESS=$ADMIN_USER@$HOSTNAME' >> /etc/cron.hourly/${gnusocial_type}-daemons
469 469
     echo -n "    echo \"Restarting ${gnusocial_type} daemons\" | mail -s \"${gnusocial_type} " >> /etc/cron.hourly/${gnusocial_type}-daemons
470 470
     echo 'daemons not found" $MY_EMAIL_ADDRESS' >> /etc/cron.hourly/${gnusocial_type}-daemons
471
-    echo '    scripts/startdaemons.sh' >> /etc/cron.hourly/${gnusocial_type}-daemons
471
+    echo '    su -c "sh scripts/startdaemons.sh" -s /bin/sh www-data' >> /etc/cron.hourly/${gnusocial_type}-daemons
472 472
     echo 'fi' >> /etc/cron.hourly/${gnusocial_type}-daemons
473 473
 
474 474
     echo 'php scripts/delete_orphan_files.php > /dev/null' >> /etc/cron.hourly/${gnusocial_type}-daemons