Skip to content

Instantly share code, notes, and snippets.

@chrisk
Created April 14, 2014 09:08
Show Gist options
  • Save chrisk/10630382 to your computer and use it in GitHub Desktop.
Save chrisk/10630382 to your computer and use it in GitHub Desktop.
Patch for pgrep bug in /etc/init.d/dropbox
--- /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