1

The command is

ps-watcher $HOME/ps-watcher.cfg

Is I run it as normal user, I got this error:

Unable to open file handle FH for file '/var/run/ps-watcher.pid': Permission denied

The content of ps-watcher.cfg is:

[tint2]
occurs = none
action = /usr/bin/tint2

Ironically, the man page says ps-watcher doesn't need to be run as root.

There's nothing in the ps command or ps-watcher, that requires one to run this daemon as root.

How to avoid the error? Can I change the path of /var/run/ps-watcher.pid?

  • What are the permissions of /var/run/ps-watcher.pid? – Alxs Apr 20 '17 at 11:07
  • /var/run is owned by root. Turns out ps-watcher is a perl script. I have just changed the file path. – godblessfq Apr 23 '17 at 1:47
  • One solution is to modified ps-wather directly. Change this line $PIDFILE = $ENV{'ps_watcher_pid_file'}; Then define an variable before calling ps-watcher. export ps_watcher_pid_file="$HOME/ps_watcher.pid" – godblessfq Apr 23 '17 at 1:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.