4 ms·
> If I run /etc/init.d/foo start [...] inherits everything from the shell 'su' and 'env' helped a lot all that decades. Until everyone started using sodo passw
by Woodi 3y ago
> If I run /etc/init.d/foo start [...] inherits everything from the shell
'su' and 'env' helped a lot all that decades. Until everyone started using sodo passwordless :)
> If I instead run service foo start, the tool instead sends a message to PID 1 process to fork the service, inheriting everything from PID 1
Wait, you just want clean service ? I thinked usecase need to recognize how it is started and react to that ! But ok, send a signal 9 and inittabzerod will fork it with inheriting everything from pid 1 :)
> > And "spaces" problem is solved
> No, it's not
Ok, it isn't :) They even rewrote git in C to use file descriptors instead of text paths. But moustly it is becouse it is a very known problem with decades of solutions already implemented in common tools.
> Write a shell script that reads a shell command (that contains quoted arguments with spaces in them!) from a file, appends some extra arguments to that command, and runs that command
So: do shell meta programming in shell ?? :) That's clear abuse becouse shell is not general purpose programming language.
And how you do just that with systemd ? :)
But if you want some editable template file then oneliner in sed or awk or perl or ... with some structure will do. No need for introducing CVEs with new and soon to be rewriten or removed or abandoned parser somewhere in milions of lines.