Created
April 14, 2014 09:08
-
-
Save chrisk/10630382 to your computer and use it in GitHub Desktop.
Patch for pgrep bug in /etc/init.d/dropbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /etc/init.d/dropbox | |
+++ /etc/init.d/dropbox-fixed | |
@@ -26,7 +34,8 @@ | |
status() { | |
for dbuser in $DROPBOX_USERS; do | |
- dbpid=`pgrep -u $dbuser dropbox` | |
+ HOMEDIR=`getent passwd $dbuser | cut -d: -f6` | |
+ dbpid=`ps -u $dbuser -o pid,cmd | grep "$HOMEDIR"/"$DAEMON"\$ | awk '{ print \$1 }'` | |
if [ -z $dbpid ] ; then | |
echo "dropboxd for USER $dbuser: not running." | |
else |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment