Skip to content

Send parent pid to nsm#32

Open
grammoboy2 wants to merge 2 commits intojpcima:masterfrom
grammoboy2:send_parent_pid_to_nsm
Open

Send parent pid to nsm#32
grammoboy2 wants to merge 2 commits intojpcima:masterfrom
grammoboy2:send_parent_pid_to_nsm

Conversation

@grammoboy2
Copy link

This a way to match the pid send from adljack to that of the process started by the NSM daemon.

It sends the parent pid (the pid of the terminal adljack is launched in) and let's adljack exite by catching SIGHUP when the terminal application gets SIGTERM from the NSM daemon.

Adljack still works this way in NSM. You might want to test it yourself to first.

See: #28

g added 2 commits November 4, 2024 15:39
Adljack starts itself in a terminal application. The terminal application obtains
the same pid as is started by the NSM daemon. This is the pid the NSM Daemon 'owns'.

To announce with the same pid as the process started by the NSM daemon, it's needed
to use getppid (get parent pid), this is the pid of the terminal, whereas
getpid gets us the pid of adljack.
When under NSM session management, a NSM clients needs to exite when it gets a SIGTERM
signal from the NSM daemon. The case of adljack is a special one, as it launches
itself in a terminal application.

To match the pid process of the NSM daemon when it starts adljack, the pid of the
terminal application is send (parent pid). So the terminal applications get the
SIGTERM signal from the NSM daemon.

SIGHUP is a signal sent to a process when its controlled terminal is closed.
So by adding SIGHUP to the catched signals, adljack exites when the
terminal application adljack is launched in, gets a SIGTERM signal.
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 this pull request may close these issues.

1 participant