Dietpi: Process tool problem

Created on 4 Oct 2018  ·  17Comments  ·  Source: MichaIng/DietPi

I tried updating transmission but it stops because of an error.
How can I fix this?

/DietPi/dietpi/.dietpi-process_tool: line 11: php-fpm: command not found
/DietPi/dietpi/.dietpi-process_tool: line 12: plexmediaerver: command not found
[ SUB2 ] DietPi-Process_tool > Apply
pgrep: only one pattern can be provided
Try `pgrep --help' for more information.
[FAILED] DietPi-Process_tool | Plex Media Server () : Affinity 0-3
[FAILED] DietPi-Process_tool | An issue has occurred

Bug Solution available

Most helpful comment

Okay PR up: https://github.com/Fourdee/DietPi/pull/2119

  • As well I replaced many awk/sed calls with ${varXXX} manipulations. Should speed up the script.

All 17 comments

@roelfoubert
Thanks for your report.

Please do:

rm /DietPi/dietpi/.dietpi-process_tool
dietpi-process_tool 1

This should resolve it. Cause is a rework we did on process tool with DietPi v6.8 where we actually reset the above config file, but somehow, most likely due to Linux async disk writes, it did not survive the reboot. Strange that there is no way until now that the kernel forces all held back writes to disk before shutting down 🤔.

I get this, so still an error

root@RaspberryPi:~# dietpi-process_tool 1
[ OK ] Root access verified.
Exception caught
Exception: [download_helper.cc:420] errorCode=1 Unrecognized URI or unsupported protocol: 0

Too many arguments
cron: can't lock /var/run/crond.pid, otherpid may be 1478: Resource temporarily unavailable
/DietPi/dietpi/.dietpi-process_tool: line 5: JackettConsole.exe: command not found
2018-10-05 13:21:06,604 proftpd[2331]: fatal: unknown parameter: '0'
/DietPi/dietpi/.dietpi-process_tool: line 7: Radarr.exe: command not found
/DietPi/dietpi/.dietpi-process_tool: line 8: NzbDrone.exe: command not found
Transmission 2.92 (14714) http://www.transmissionbt.com/
A fast and easy BitTorrent client

transmission-daemon is a headless Transmission session
that can be controlled via transmission-remote
or the web interface.

Usage: transmission-daemon [options]

Options:
-h --help Display this help page and exit
-a --allowed Allowed IP addresses. (Default:
127.0.0.1)
-b --blocklist Enable peer blocklists
-B --no-blocklist Disable peer blocklists
-c --watch-dir Where to watch for new .torrent files
-C --no-watch-dir Disable the watch-dir
--incomplete-dir Where to store new torrents until
they're complete
--no-incomplete-dir Don't store incomplete torrents in a
different location
-d --dump-settings Dump the settings and exit
-e --logfile Dump the log messages to this filename
-f --foreground Run in the foreground instead of
daemonizing
-g --config-dir Where to look for configuration files
-p --port RPC port (Default: 9091)
-t --auth Require authentication
-T --no-auth Don't require authentication
-u --username Set username for authentication
-v --password Set password for authentication
-V --version Show version number and exit
--log-error Show error messages
--log-info Show error and info messages
--log-debug Show error, info, and debug messages
-w --download-dir Where to save downloaded data
--paused Pause all torrents on startup
-o --dht Enable distributed hash tables (DHT)
-O --no-dht Disable distributed hash tables (DHT)
-y --lpd Enable local peer discovery (LPD)
-Y --no-lpd Disable local peer discovery (LPD)
--utp Enable uTP for peer connections
--no-utp Disable uTP for peer connections
-P --peerport Port for incoming peers (Default:
51413)
-m --portmap Enable portmapping via NAT-PMP or UPnP
-M --no-portmap Disable portmapping
-L --peerlimit-global Maximum overall number of peers
(Default: 200)
-l --peerlimit-torrent Maximum number of peers per torrent
(Default: 50)
-er --encryption-required Encrypt all peer connections
-ep --encryption-preferred Prefer encrypted peer connections
-et --encryption-tolerated Prefer unencrypted peer connections
-i --bind-address-ipv4 Where to listen for peer connections
-I --bind-address-ipv6 Where to listen for peer connections
-r --rpc-bind-address Where to listen for RPC connections
-gsr --global-seedratio ratio All torrents, unless overridden by a
per-torrent setting, should seed until
a specific ratio
-GSR --no-global-seedratio All torrents, unless overridden by a
per-torrent setting, should seed
regardless of ratio
-x --pid-file Enable PID file
2018-10-05 13:21:06: (server.c.824) No configuration available. Try using -f option.
/DietPi/dietpi/.dietpi-process_tool: line 11: php-fpm: command not found

DietPi-Process_tool
─────────────────────────────────────────────────────
Mode: Apply

[ OK ] DietPi-Process_tool | Aria2 (1239) : Nice 0
[ OK ] DietPi-Process_tool | Aria2 (1239) : Affinity 0-3
[ OK ] DietPi-Process_tool | Aria2 (1239) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Avahi Daemon (1185) : Nice 0
[ OK ] DietPi-Process_tool | Avahi Daemon (1185) : Affinity 0-3
[ OK ] DietPi-Process_tool | Avahi Daemon (1185) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Avahi Daemon (1186) : Nice 0
[ OK ] DietPi-Process_tool | Avahi Daemon (1186) : Affinity 0-3
[ OK ] DietPi-Process_tool | Avahi Daemon (1186) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Cron (1478) : Nice 0
[ OK ] DietPi-Process_tool | Cron (1478) : Affinity 0-3
[ OK ] DietPi-Process_tool | Cron (1478) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Dropbear (886) : Nice 0
[ OK ] DietPi-Process_tool | Dropbear (886) : Affinity 0-3
[ OK ] DietPi-Process_tool | Dropbear (886) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Dropbear (1909) : Nice 0
[ OK ] DietPi-Process_tool | Dropbear (1909) : Affinity 0-3
[ OK ] DietPi-Process_tool | Dropbear (1909) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Home Assistant (1418) : Nice 0
[ OK ] DietPi-Process_tool | Home Assistant (1418) : Affinity 0-3
[ OK ] DietPi-Process_tool | Home Assistant (1418) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Jackett (1241) : Nice 0
[ OK ] DietPi-Process_tool | Jackett (1241) : Affinity 0-3
[ OK ] DietPi-Process_tool | Jackett (1241) : Scheduler SCHED_OTHER 0
pgrep: only one pattern can be provided
Try `pgrep --help' for more information.
[ OK ] DietPi-Process_tool | Plex Media Server () : Nice 0
[FAILED] DietPi-Process_tool | Plex Media Server () : Affinity 0-3
[ OK ] DietPi-Process_tool | Plex Media Server () : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | ProFTP (1198) : Nice 0
[ OK ] DietPi-Process_tool | ProFTP (1198) : Affinity 0-3
[ OK ] DietPi-Process_tool | ProFTP (1198) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Radarr (1245) : Nice 0
[ OK ] DietPi-Process_tool | Radarr (1245) : Affinity 0-3
[ OK ] DietPi-Process_tool | Radarr (1245) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Sonarr (1243) : Nice 0
[ OK ] DietPi-Process_tool | Sonarr (1243) : Affinity 0-3
[ OK ] DietPi-Process_tool | Sonarr (1243) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Transmission (1227) : Nice 0
[ OK ] DietPi-Process_tool | Transmission (1227) : Affinity 0-3
[ OK ] DietPi-Process_tool | Transmission (1227) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Webserver Lighttpd (1217) : Nice 0
[ OK ] DietPi-Process_tool | Webserver Lighttpd (1217) : Affinity 0-3
[ OK ] DietPi-Process_tool | Webserver Lighttpd (1217) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1200) : Nice 0
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1200) : Affinity 0-3
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1200) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1204) : Nice 0
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1204) : Affinity 0-3
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1204) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1205) : Nice 0
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1205) : Affinity 0-3
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1205) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1206) : Nice 0
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1206) : Affinity 0-3
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1206) : Scheduler SCHED_OTHER 0
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1207) : Nice 0
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1207) : Affinity 0-3
[ OK ] DietPi-Process_tool | Webserver Php-fpm (1207) : Scheduler SCHED_OTHER 0
[FAILED] DietPi-Process_tool | An issue has occurred

Very strange, there are still the wrong entries in .dietpi-process_tool.

Could you please paste output of:
cat /DietPi/dietpi/.dietpi-process_tool

This is what I get

root@RaspberryPi:~# cat /DietPi/dietpi/.dietpi-process_tool
aria2c 0 0-3 SCHED_OTHER 0
avahi-daemon 0 0-3 SCHED_OTHER 0
cron 0 0-3 SCHED_OTHER 0
dropbear 0 0-3 SCHED_OTHER 0
JackettConsole.exe 0 0-3 SCHED_OTHER 0
proftpd 0 0-3 SCHED_OTHER 0
Radarr.exe 0 0-3 SCHED_OTHER 0
NzbDrone.exe 0 0-3 SCHED_OTHER 0
transmission-daemon 0 0-3 SCHED_OTHER 0
lighttpd 0 0-3 SCHED_OTHER 0
php-fpm 0 0-3 SCHED_OTHER 0

@roelfoubert
Yeah that is the old style. And if you remove this file and rerun process tool, it looks the same again?

I always get the same error

@roelfoubert

[ SUB2 ] DietPi-Process_tool > Apply
pgrep: only one pattern can be provided
Try `pgrep --help' for more information.

Is a known issue with v6.16, apologies.

It is resolved for v6.17: https://github.com/Fourdee/DietPi/issues/2089#issuecomment-427625930

We are hoping to open v6.17 beta testing to public users next week. Until then, the other option is to edit the following file:

/DietPi/dietpi/dietpi-process_tool

Find the following line:

done <<< "$(pgrep -f ${aPROCESS_NAME[$i]})"

Replace with:

done <<< $(pgrep -f "${aPROCESS_NAME[$i]}")

Issue is caused by pgrep not single string entry of ${aPROCESS_NAME[$i]}.

@roelfoubert

root@RaspberryPi:~# cat /DietPi/dietpi/.dietpi-process_tool
aria2c 0 0-3 SCHED_OTHER 0
avahi-daemon 0 0-3 SCHED_OTHER 0
cron 0 0-3 SCHED_OTHER 0
dropbear 0 0-3 SCHED_OTHER 0
JackettConsole.exe 0 0-3 SCHED_OTHER 0
proftpd 0 0-3 SCHED_OTHER 0
Radarr.exe 0 0-3 SCHED_OTHER 0
NzbDrone.exe 0 0-3 SCHED_OTHER 0
transmission-daemon 0 0-3 SCHED_OTHER 0
lighttpd 0 0-3 SCHED_OTHER 0
php-fpm 0 0-3 SCHED_OTHER 0

Which version of DietPi are you running? The above fix may not be the solution.

I'm using the latest version 6.16

changing the line in /DietPi/dietpi/dietpi-process_tool fixed my problem

@roelfoubert

changing the line in /DietPi/dietpi/dietpi-process_tool fixed my problem

I am confused now. Maybe there was some disk async reason for /DietPi/dietpi/.dietpi-process_tool not being updated, or patch went wrong. However if you face no error messages any more, process tool seems to have successfully overwritten it's config file for fix.


There were two issues:

The fix above should have solved only this part of your posted terminal output:

pgrep: only one pattern can be provided
Try `pgrep --help' for more information.
[ OK ] DietPi-Process_tool | Plex Media Server () : Nice 0
[FAILED] DietPi-Process_tool | Plex Media Server () : Affinity 0-3
  • This is known for v6.16 and fixed with above for v6.17.

The first errors you got:

cron: can't lock /var/run/crond.pid, otherpid may be 1478: Resource temporarily unavailable
/DietPi/dietpi/.dietpi-process_tool: line 5: JackettConsole.exe: command not found
2018-10-05 13:21:06,604 proftpd[2331]: fatal: unknown parameter: '0'
/DietPi/dietpi/.dietpi-process_tool: line 7: Radarr.exe: command not found
/DietPi/dietpi/.dietpi-process_tool: line 8: NzbDrone.exe: command not found
...

are due to cat /DietPi/dietpi/.dietpi-process_tool being in a style that we used some versions ago, but should not look like this on version v6.16, specially not after removing this file and rerunning dietpi-process_tool.
If this errors still appear, I would suggest to rerun dietpi-update -1, as something would have gone wrong with the last update.

@Fourdee
The fix opened another issue:

[  OK  ] DietPi-Process_tool | Dropbear (516 570) : Nice      0
[FAILED] DietPi-Process_tool | Dropbear (516 570) : Affinity  0-3
[  OK  ] DietPi-Process_tool | Dropbear (516 570) : Scheduler SCHED_OTHER 0
[FAILED] DietPi-Process_tool | An issue has occurred

Whole loop into need to be in double quotes, otherwise if process name matches multiple processes, their IDs will be in one line.

@MichaIng

Whole loop into need to be in double quotes, otherwise if process name matches multiple processes, their IDs will be in one line.

Works fine for me on Stretch:

root@DietPi:~# dietpi-process_tool 1
[  OK  ] Root access verified.

 DietPi-Process_tool
─────────────────────────────────────────────────────
 Mode: Apply

[  OK  ] DietPi-Process_tool | Cron (4764) : Nice      0
[  OK  ] DietPi-Process_tool | Cron (4764) : Affinity  0-5
[  OK  ] DietPi-Process_tool | Cron (4764) : Scheduler SCHED_OTHER 0
[  OK  ] DietPi-Process_tool | OpenSSH Server (591) : Nice      0
[  OK  ] DietPi-Process_tool | OpenSSH Server (591) : Affinity  0-5
[  OK  ] DietPi-Process_tool | OpenSSH Server (591) : Scheduler SCHED_OTHER 0
[  OK  ] DietPi-Process_tool | OpenSSH Server (6444) : Nice      0
[  OK  ] DietPi-Process_tool | OpenSSH Server (6444) : Affinity  0-5
[  OK  ] DietPi-Process_tool | OpenSSH Server (6444) : Scheduler SCHED_OTHER 0
[  OK  ] DietPi-Process_tool | Completed
root@DietPi:~# pgrep ssh
591
6444

You running Jessie?


Neither of these work:

"$(pgrep -f \"${aPROCESS_NAME[$i]}\")"
"$(pgrep -f '${aPROCESS_NAME[$i]}')"

So, unless we can find out solution, we'd need to > tmp then read that.

@Fourdee
Hmm strange, issue appears on Jessie yes, dropbear process. Hmm actually the error makes sense, since without double quotes, all output is in one line, thus should be "591 6444" in this case 🤔.

However, "$(pgrep -f "${aPROCESS_NAME[$i]}")" (doubled double quotes) works in all cases. I am already fixing it, just doing some other stuff as well.

@MichaIng

"$(pgrep -f "${aPROCESS_NAME[$i]}")"

So it does 👍 could of sworn I tried that earlier and it didn't work (probably not enough coffee!) 🤣. Working fine now with above :)

Okay PR up: https://github.com/Fourdee/DietPi/pull/2119

  • As well I replaced many awk/sed calls with ${varXXX} manipulations. Should speed up the script.

@MichaIng

Issues are now resolved, i'll mark this as closed.

Was this page helpful?
0 / 5 - 0 ratings