DietPi-Process_Tool | Faulty /DietPi/dietpi/.dietpi-process_tool entries leading to errors

Created on 29 May 2018  ·  8Comments  ·  Source: MichaIng/DietPi

Via forum: https://dietpi.com/phpbb/viewtopic.php?f=11&t=3784

I also watched this, DietPi-Process_Tool trying to execute a process that is not present any more (in my case dhclient). The availability of the process could be checked a bid more careful, assuring that no other process with pattern inside, e.g. as part of the name or command argument, e.g. by matching just awk '{print $5}' for the process name (full command path without arguments): https://github.com/Fourdee/DietPi/blob/testing/dietpi/dietpi-process_tool#L362

But this is actually not the issue, as I thought that time. There seem to be entries within the settings file, containing a process name as first word in a line or after ; or something, as by times those processes are tried to be called, instead of arrays filled as expected: https://github.com/Fourdee/DietPi/blob/testing/dietpi/dietpi-process_tool#L430

I was going through the code, but couldn't find a hint what could lead to this. Needs investigation, in case testing to install all software titles the user had installed and see if we are able to reproduce.

Via Forum

Most helpful comment

@MichaIng

Seems we both did similar fixes to the process_tool script at the same time lol 👍

I'll merge your changes into my version, then send commit. Done :) https://github.com/Fourdee/DietPi/commit/c573560ed2710ab36ea8498a65eb3f8f297c6492 + https://github.com/Fourdee/DietPi/commit/83b5d1897c3dc639acf454d7807b834da769dee2

All 8 comments

@MichaIng

Requested bug report, want to check his /DietPi/dietpi/.dietpi-process_tool, might be corrupt.

I'll check to see if the process tool save file updates processes that are no longer available. I believe it should do this by default, but i'll check.

Process_tool test, removal of processes no longer available:

No issues found. Processes that do no exist are not applied from the save file. running dietpi-process_tool then exit, clears any unavailable process saves from the save file.

  • Stock
root@DietPi:~# cat /DietPi/dietpi/.dietpi-process_tool
aname_save[0]='cron'
anice_save[0]=0
aaffinity_save[0]='0-3'
aschedule_policy_save[0]='SCHED_OTHER'
aschedule_priority_save[0]='0'
aname_save[1]='sshd'
anice_save[1]=0
aaffinity_save[1]='0-3'
aschedule_policy_save[1]='SCHED_OTHER'
aschedule_priority_save[1]='0'
  • NextCloud | run dietpi-process_tool
root@DietPi:~# cat /DietPi/dietpi/.dietpi-process_tool
aname_save[0]='cron'
anice_save[0]=0
aaffinity_save[0]='0-3'
aschedule_policy_save[0]='SCHED_OTHER'
aschedule_priority_save[0]='0'
aname_save[1]='sshd'
anice_save[1]=0
aaffinity_save[1]='0-3'
aschedule_policy_save[1]='SCHED_OTHER'
aschedule_priority_save[1]='0'
aname_save[2]='lighttpd'
anice_save[2]=0
aaffinity_save[2]='0-3'
aschedule_policy_save[2]='SCHED_OTHER'
aschedule_priority_save[2]='0'
aname_save[3]='mysqld'
anice_save[3]=0
aaffinity_save[3]='0-3'
aschedule_policy_save[3]='SCHED_OTHER'
aschedule_priority_save[3]='0'
aname_save[4]='php-fpm'
anice_save[4]=0
aaffinity_save[4]='0-3'
aschedule_policy_save[4]='SCHED_OTHER'
aschedule_priority_save[4]='0'
aname_save[5]='redis-server'
anice_save[5]=0
aaffinity_save[5]='0-3'
aschedule_policy_save[5]='SCHED_OTHER'
aschedule_priority_save[5]='0'
  • Uninstall of NextCloud + all web | auto restart of dietpi-process_tool at end of uninstall
[  OK  ] DietPi-Services | start : cron
[ SUB2 ] DietPi-Process_tool > Apply
[  OK  ] DietPi-Process_tool | Completed

#####
root@DietPi:~# cat /DietPi/dietpi/.dietpi-process_tool
aname_save[0]='cron'
anice_save[0]=0
aaffinity_save[0]='0-3'
aschedule_policy_save[0]='SCHED_OTHER'
aschedule_priority_save[0]='0'
aname_save[1]='sshd'
anice_save[1]=0
aaffinity_save[1]='0-3'
aschedule_policy_save[1]='SCHED_OTHER'
aschedule_priority_save[1]='0'
aname_save[2]='lighttpd'
anice_save[2]=0
aaffinity_save[2]='0-3'
aschedule_policy_save[2]='SCHED_OTHER'
aschedule_priority_save[2]='0'
aname_save[3]='mysqld'
anice_save[3]=0
aaffinity_save[3]='0-3'
aschedule_policy_save[3]='SCHED_OTHER'
aschedule_priority_save[3]='0'
aname_save[4]='php-fpm'
anice_save[4]=0
aaffinity_save[4]='0-3'
aschedule_policy_save[4]='SCHED_OTHER'
aschedule_priority_save[4]='0'
aname_save[5]='redis-server'
anice_save[5]=0
aaffinity_save[5]='0-3'
aschedule_policy_save[5]='SCHED_OTHER'
aschedule_priority_save[5]='0'

  • dietpi-process_tool, then exit
root@DietPi:~# cat /DietPi/dietpi/.dietpi-process_tool
aname_save[0]='cron'
anice_save[0]=0
aaffinity_save[0]='0-3'
aschedule_policy_save[0]='SCHED_OTHER'
aschedule_priority_save[0]='0'
aname_save[1]='sshd'
anice_save[1]=0
aaffinity_save[1]='0-3'
aschedule_policy_save[1]='SCHED_OTHER'
aschedule_priority_save[1]='0'
aname_save[2]='mariadb'
anice_save[2]=0
aaffinity_save[2]='0-3'
aschedule_policy_save[2]='SCHED_OTHER'
aschedule_priority_save[2]='0'
aname_save[3]='mysqld'
anice_save[3]=0
aaffinity_save[3]='0-3'
aschedule_policy_save[3]='SCHED_OTHER'
aschedule_priority_save[3]='0'
  • reboot, dietpi-process_tool 1:
root@DietPi:~# dietpi-process_tool 1
[  OK  ] Root access verified.

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

[  OK  ] DietPi-Process_tool | Cron (986) : Nice      0
[  OK  ] DietPi-Process_tool | Cron (986) : Affinity  0-3
[  OK  ] DietPi-Process_tool | Cron (986) : Scheduler SCHED_OTHER 0
[  OK  ] DietPi-Process_tool | OpenSSH Server (510) : Nice      0
[  OK  ] DietPi-Process_tool | OpenSSH Server (510) : Affinity  0-3
[  OK  ] DietPi-Process_tool | OpenSSH Server (510) : Scheduler SCHED_OTHER 0
[  OK  ] DietPi-Process_tool | OpenSSH Server (1576) : Nice      0
[  OK  ] DietPi-Process_tool | OpenSSH Server (1576) : Affinity  0-3
[  OK  ] DietPi-Process_tool | OpenSSH Server (1576) : Scheduler SCHED_OTHER 0
[  OK  ] DietPi-Process_tool | Completed
root@DietPi:~# cat /DietPi/dietpi/.dietpi-process_tool
aname_save[0]='cron'
anice_save[0]=0
aaffinity_save[0]='0-3'
aschedule_policy_save[0]='SCHED_OTHER'
aschedule_priority_save[0]='0'
aname_save[1]='sshd'
anice_save[1]=0
aaffinity_save[1]='0-3'
aschedule_policy_save[1]='SCHED_OTHER'
aschedule_priority_save[1]='0'
aname_save[2]='mariadb'
anice_save[2]=0
aaffinity_save[2]='0-3'
aschedule_policy_save[2]='SCHED_OTHER'
aschedule_priority_save[2]='0'
aname_save[3]='mysqld'
anice_save[3]=0
aaffinity_save[3]='0-3'
aschedule_policy_save[3]='SCHED_OTHER'
aschedule_priority_save[3]='0'
  • dietpi-process_tool then exit
root@DietPi:~# cat /DietPi/dietpi/.dietpi-process_tool
aname_save[0]='cron'
anice_save[0]=0
aaffinity_save[0]='0-3'
aschedule_policy_save[0]='SCHED_OTHER'
aschedule_priority_save[0]='0'
aname_save[1]='sshd'
anice_save[1]=0
aaffinity_save[1]='0-3'
aschedule_policy_save[1]='SCHED_OTHER'
aschedule_priority_save[1]='0'

I've yet to see these errors:

cron: can't lock /var/run/crond.pid, otherpid may be 3940: Resource temporarily unavailable
/DietPi/dietpi/.dietpi-process_tool: line 3: netdata: command not found

Ok, we could update the save file, when non-menu mode is run, eg: dietpi-process_tool 1. However, if the process does not exist at run, it does not get applied, as expected.
Although, if a user applies a specific setting to a process, and, that process does not scrape at the time of dietpi-process_tool 1, their applied setting will be lost.

@MichaIng

Seems we both did similar fixes to the process_tool script at the same time lol 👍

I'll merge your changes into my version, then send commit. Done :) https://github.com/Fourdee/DietPi/commit/c573560ed2710ab36ea8498a65eb3f8f297c6492 + https://github.com/Fourdee/DietPi/commit/83b5d1897c3dc639acf454d7807b834da769dee2

@Fourdee
Whoopsie, next time I create PR again. Though to be no issue, as there were no functional changes inside. But I don't want to cause a mess, if you do changes to your local repo 😉.

@MichaIng

No worries, its all good 👍

No response from user, unable to replicate. Assuming corrupt save file, possible cause of hardware instability.

Either way, our script has been updated/reviewed for v6.9.

I'll mark this as closed, however should https://github.com/Fourdee/DietPi/issues/1808#issuecomment-392925453 reoccur, we'll reopen (i'am yet to see this issue)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mok-liee picture mok-liee  ·  3Comments

Fourdee picture Fourdee  ·  3Comments

Invictaz picture Invictaz  ·  3Comments

MichaIng picture MichaIng  ·  3Comments

Invictaz picture Invictaz  ·  3Comments