Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[remux] xochitl is not started for new rm2fb version in toltec #127

Closed
JanLuca opened this issue May 21, 2021 · 6 comments · May be fixed by #128
Closed

[remux] xochitl is not started for new rm2fb version in toltec #127

JanLuca opened this issue May 21, 2021 · 6 comments · May be fixed by #128

Comments

@JanLuca
Copy link

JanLuca commented May 21, 2021

proc.list_procs uses the program name defined in /proc/<id>/stat to build up its process list. This causes the problem that it does not account that programs changed their argv[0] to be listed by a different cmdline.

Particularity, this behavior causes the problem that remux is not compatible with the new rm2fb version released on toltec for the update 2.6+ since rm2fb-server now uses xochitl instead of remarkable-shutdown [1]. To avoid the problem that it is listed by the wrong name it changes the cmdline to rm2fb-server [1] so that /proc/<id>/cmdline contains correctly rm2fb-server but since the underlying exe is xochitl the second value of /proc/<id>/stat is (xochitl).

This way remux assumes that xochitl --system is already started which is not correct.

I would either suggest to include a check in the process list code if the cmdline and stat differs or depend on systemctl start/stop xochitl to handle the execution and state of xochitl.

[1] toltec-dev/toltec@12e6fb4

@raisjn
Copy link
Member

raisjn commented May 21, 2021

thanks for investigating! I thought this was fixed

cc @matteodelabre

@JanLuca
Copy link
Author

JanLuca commented May 21, 2021

I think toltec-dev/toltec@12e6fb4 already includes a patch but this just changes cmdline. The problem is that according to man 5 proc the second field is always the name of the executable.

But I just tested it: The problem can be fixed by creating a symlink to /usr/bin/xochitl and call this. Then the exec name is correct in stat as well

@raisjn
Copy link
Member

raisjn commented May 21, 2021

regarding using systemctl to manage xochitl: the default xochitl.service has a watchdog which will restart the process if it doesn't ping every X minutes. this interferes with backgrounding xochitl. since I want to leave the system service mostly unmodified, remux behaves the way it does. if systemctl supports pause, can switch to that

for the symlink: is Toltec or rm2fb a good place to put a PR?

for stat vs cmdline: can remux switch to cmdline and things would work?

@JanLuca
Copy link
Author

JanLuca commented May 21, 2021

I just try to solve this using a symlink and if this works I open a PR on toltec

@JanLuca
Copy link
Author

JanLuca commented May 21, 2021

Ok, the name in /proc/<id>/stat is not the problem. The problem is in the function check_args. It returns true if somewhere in a path is the name of argument. For example it returns true for the cmdline inotifywait -m -q --format %f -e DELETE /home/root/.local/share/remarkable/xochitl where the name is just the name of the data dir. I think the check logic has to be adapted but I have no time now to think about a better solution maybe you can take a look into it.

PS: I still opened a PR for the symlink fix: toltec-dev/toltec#359

matteodelabre added a commit to toltec-dev/toltec that referenced this issue Jun 4, 2021
This update includes a change in the server code to set the server
process name to 'rm2fb-server' (instead of the default 'xochitl'). See
also #359 and rmkit-dev/rmkit#127.

Test plan: Started the 'rm2fb' service, retrieved the server PID, and
made sure that both `/proc/PID/cmdline` and `/proc/PID/stat` contained
'rm2fb-server' instead of 'xochitl'.
matteodelabre added a commit to toltec-dev/toltec that referenced this issue Jun 6, 2021
This update includes a change in the server code to set the server
process name to 'rm2fb-server' (instead of the default 'xochitl'). See
also #359 and rmkit-dev/rmkit#127.
@matteodelabre
Copy link

I think this can be closed, since the issue has been fixed in toltec-dev/toltec#363.

@raisjn raisjn closed this as completed Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants