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?

3
  • What are the permissions of /var/run/ps-watcher.pid?
    – Alxs
    Apr 20, 2017 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, 2017 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, 2017 at 1:51

0

You must log in to answer this question.

Browse other questions tagged .