Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Some beginners questions (Read 1149 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

[SOLVED] Some beginners questions

  • cryptsetup and lvm2 are added to boot automatically, why isnt device-mapper added to boot automatically?
  • What is the command to see which services currently are in a bundle (e.g. default or boot bundle)?
  • In the wiki it says "Note: There is a bundle within default called boot." If that is true, is it possible to see the services in a bundle (e.g. default bundle) as a tree structure?
  • How do you see all available services that can be added to bundles?
  • How do you see the log of a running service?
  • How do you see the log of an already terminated service?
  • How do you see whether a service is currently running?
  • How do you see which services are currently running?
  • In some scripts it says something like DIRECTIVES="n3 s2000000 T". What is that DIRECTIVES for? And where do the numbers come from?
  • In notification-fd files, there is a single number, like 3. Where do these numbers come from? And what do they mean?
  • Can you always use #!/bin/bash in "run" files, or only for oneshots?
  • Are there some simple guides to create my own services?
  • Where can I find the logs of cronie-s6? It doesn't seem like there is a log service.

Re: Some beginners questions

Reply #1
Answering in order here.

  • cryptsetup and lvm2 are added because some devices could need those services before they can mount. They're special. I don't really know about device-mapper and hopefully it doesn't work this way because I don't really like this mechanism.
  • s6-rc-db contents bundlename
  • It's true. I don't know about a "tree structure" but you can see all the contents fine with the above command.
  • s6-rc-db list services
  • Just look in /var/log
  • Same thing. Look in /var/log
  • s6-rc -a list
  • Same thing as above.
  • This is used for s6-log. See the upstream documentation. The defaults are completely arbitrary and chosen by me.
  • This is for readiness notification. Check the upstream documentation for more details.
  • run files can use any valid shebang. You could even make services in python if you really wanted to. oneshot scripts are required to use execline because of how s6-rc works but you can make your execline script simply a command to another script in another language. There's a few places in Artix where this is done so there is no limitation in practice.
  • There are no simple guides. I recommend reading upstream documentation if you want to do this.
  • If I recall correctly cronie doesn't log anything at all which is why it has no log service.

Re: Some beginners questions

Reply #2
Thanks, that really helped me a lot!  :)

Re: [SOLVED] Some beginners questions

Reply #3
In the wiki it says "Note: There is a bundle within default called boot." If that is true, is it possible to see the services in a bundle (e.g. default bundle) as a tree structure?

Not in s6.

66 has "trees" and a command to show a tree similar to tree(1).

Where can I find the logs of cronie-s6? It doesn't seem like there is a log service.
/var/log/crond.log

(Disclaimer: I use syslog-ng.)

If you are interested in logs, I recommend installing a file manager like GNU mc, a clone of Norton Commander (sudo pacman -S mc) and going to /var/log in it (Alt+C, then type /var/log inside mc). F3 previews a file and also ends the preview. F10 exits. Some log files require root privileges for reading, so you would have to run it as root, just be careful not to move (F6), delete (F8) or edit (F4) and save any files.

Re: [SOLVED] Some beginners questions

Reply #4
Thanks, installing syslog-ng-s6, starting it, and then restarting cronie helped and there is now a file called /var/log/crond.log.  :)
But I'm not so sure, what happens when cronie starts before syslog-ng on startup. Is that a race condition or will the logs work nonetheless?

Quote
Not in s6. 66 has "trees" and a command to show a tree similar to tree(1).
I see, thanks. I will try to create my own tree command, then.

Quote
I recommend installing a file manager like GNU mc, a clone of Norton Commander
I will take a look at it. Currently, I'm just using (sudo) cat.

Re: [SOLVED] Some beginners questions

Reply #5
There's no race condition for any daemon that reads syslog. Stuff that is written to /dev/log before the daemon is up is still read. If you are on "plain" s6, you can also opt to use syslogd-s6 instead of syslog-ng-s6 which integrates directly with s6-log so it works just like all the other logging daemons.

Re: [SOLVED] Some beginners questions

Reply #6
Quote
There's no race condition for any daemon that reads syslog. Stuff that is written to /dev/log before the daemon is up is still read.
I see, good to know :)

Just tried syslogd-s6. Does the path of the log file change with using this?
Because when I did
Code: [Select]
sudo s6-rc -d change cronie && sudo s6-rc -u change cronie
I could see a change in the log with syslog-ng-s6. But no changes with syslogd-s6.


Re: [SOLVED] Some beginners questions

Reply #8
Quote
Yes, the log files are stored in /var/log/syslogd.
That worked, thanks.  :)