You are not logged in.
Pages: 1
Hey everyone
I don't have a problem i need to fix, I encountered something I couldn't explain.
As you know the commands halt. reboot, shutdown are symlinks to systemctl (on systemd machines).
But I don't understand how systemctl know how to act. It's not like the symlink has additional data like command to run. It's just pointer to systemctl.
So how systemctl knows to do the proper action?
Last edited by idang1410 (2020-07-08 09:42:37)
Offline
It checks argv[0] and acts depending on what it says. It is quite common to do this, eg kmod and vim does the same.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
It checks argv[0] and acts depending on what it says. It is quite common to do this, eg kmod and vim does the same.
It makes sense. It's also in the source code (I checked just now)
Thanks
Offline
Pages: 1