Score:0

How to log messages from init.d scripts

se flag

I have this script in /etc/init.d, but I don't see any of its log messages in /var/log. They are of the form:

echo "ACM: here I am!" >&2

Since they are all prefixed w/"ACM", grep'ing "ACM" should make it easy to figure out where they are, but they don't seem to be anywhere.

I have a symlink in /etc/rc0.d/ given as

lrwxrwxrwx 1 root root 20 Mar 19 11:13 K01b2umount -> ../init.d/umountb2

And in /etc/init.d/ is a script that has the same permissions as all its peers. So I don't see why it wouldn't be executed. There's no way to execute that script without generating log messages, so where are they?

I'm running Ubuntu 22.04.2.

hr flag
Aren't SystemV scripts converted to systemd service units nowadays (by `systemd-sysv-generator`)? Have you checked the systemd journal (ex. `journalctl | grep umount`)
FedKad avatar
cn flag
May be related to this: https://askubuntu.com/questions/1202455/where-is-the-output-from-startup-scripts-stored-in-ubuntu-19-10
waltinator avatar
it flag
Read `man logger`.
Opux avatar
se flag
@steeldriver I tried that, but it never showed any of those log messages in my script.
Opux avatar
se flag
@waltinator After I did, I changed some of the log messages to `logger "ACM: here I am"` I still got no joy, whether I looked into `journalctl` or grep'd /var/log for it.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.