Start Root Applications Before Login

Good day, can anyone fill this command for CoreCtrl app for my rc.local? Thanks.


/sbin/ip addr | grep inet\ | tail -n1 | awk '{ print $2 }' > /etc/issue
echo "" >> /etc/issue

exit 0

what rc.local ?
… seems you talk about a different init system - systemd is used in Arch/Manjaro

documenting my steps to decipher this:

which ip

so: that is not even the same path to begin with
but it will work because /sbin is a symlink to /usr/bin
where the ip command actually resides (in Manjaro)

what does it do?

ip addr | grep inet\ | tail -n1 | awk '{ print $2 }'

That part of the command will give you your machines current IP and netmask -

the next part will then feed it into the file /etc/issue (which is only possible as root)
which is not the place to put that information
as that file has a different purpose (and content already)
and it will overwrite it, destroying the original content

That file will then be written to again, appending … nothing

echo "" >> /etc/issue

to the now altered content

You will lose the original content of /etc/issue - and you will get no output in return

if you where asking what the command returns

Yeah forgot. Can you please fill in for me a crontab then?

Yes the app is in /usr/bin, just replace anything you must. I just want to run it before login with root privileges via root crontab.

Use @reboot

This might help:

I just want to sudo crontab -e and write @reboot something, no destructive time events, just always on. What is this @reboot something for the specific app? Thanks.

Something like this?

sudo (crontab -l ; echo "@reboot /path/to/your/script/") | crontab -

no, sorry

Just sudo crontab -e then edit with VI to something like @reboot sh /usr/bin/corectrl, but didn’t work. At any rate is there a simple way to start a root app before login so i get away without password?

This is ambiguous.
And possibly not a good way to do it.
Have you heard of the term “XY problem”?

What is it that you want to achieve?