----BEGIN CLASS---- [14:00] #startclass [14:00] roll call [14:00] Saransh [14:00] Nagarajan [14:00] Robin Schubert [14:01] kiyo [14:02] you were reading and talking about processes in Linux last time [14:02] any open questions? [14:02] ! [14:03] has it even been file permissions in the same session? [14:03] no haven't read or practice lym book, will do [14:03] next [14:03] i have always used kill -9 to kill a process, when should i ever use just "kill" without the -9 option [14:04] kiyo: that's a good one [14:04] so you saw with `kill -l` that there are a lot of signals you can pass to the command [14:04] killing a process can actually be done in nice ways, or in quite hard ways [14:05] and depending on the method you choose you may as well risk data loss [14:05] some kill signals can only be executed as root, while others can be invoked by unprivileged users [14:06] some do not even kill the process, but can interrupt a certain routine [14:07] so basically send a different unix signal to a process for it to catch? [14:07] for example I use kill -USR2 when my emacs freezes for a particular reason. The command interrupts a process but does not kill my emacs session, so it unfreezes and I can continue my work [14:07] nice [14:07] kiyo: yes. It's also helpful to get some debug information sometimes [14:07] but depends on the program and how these signals can be handled [14:08] I never dived in too deep myself, but it's certainly an interesting topic [14:08] circuitlover: where did you stop reading LYM? [14:09] i've completed 2 chapters only [14:09] oh, that's not too many [14:09] so far no doubt, but will ask once i move forward [14:10] schubisu: yes :( [14:10] you should not wait too long to catch up, or the backlog will just grow [14:10] ok will finish this weekend [14:10] there has not been a reading assignment for today, so I would like you to read the chapter on Linux Services now [14:10] https://lym.readthedocs.io/en/latest/services.html [14:10] ok sure [14:10] please read until "Securing a service using systemd" [14:11] ok [14:11] and let's meet here again in 12 minutes :) [14:20] i might need longer [14:20] been reading my logs lol [14:20] kiyo: no problem, let us know when you have a question. We might proceed with some questions here already [14:22] ! [14:22] next [14:23] in the book "A service actually consists of one or more daemons.", what does it mean ?, since both are same right ? [14:24] circuitlover: no. A daemon is a process running in the background [14:24] a service can spawn multiple processes, though [14:24] oh ok got it, so that it can contain more daemons [14:25] circuitlover: yes. try running `systemctl status` on your machine and look at the number of processes/daemons of the different services [14:26] yeah i can see, but in that while running systemctl --type=service, i'm getting a red color text for fwupd process, why, does it mean stopped process or anyother ? [14:27] when i check for fwupdate, it shows it is for my uefi update [14:27] so i'm wondering why it is in red color? [14:27] maybe next try `systemctl status fwupd` to find out more [14:28] or, if you've read the section on journalctl already, use that to read some logs of that service [14:28] ok sure [14:29] ok got it, it is an inactive or dead process, thank you schubisu [14:30] circuitlover: :) [14:30] circuitlover, specbeck; did you finish reading until the "Securing a service..." section? [14:31] yes almost done [14:31] no will finish in 2 mins [14:31] ah i've gone beyond [14:31] so yes im done [14:32] specbeck, kiyo; so far any questions? [14:32] ! [14:32] kiyo: feel free to read beyond after session. It's an interesting topic, but maybe nothing most people will do too often [14:32] next [14:33] schubisu: why we go for systemd instead of already exisitng init system / [14:33] None as of now, will have to try for myself for doubts [14:34] i checked th rc files still exist, then why we go for systemd [14:34] circuitlover: that's historical, I guess ;) [14:34] people were not happy with the old init system [14:34] ok [14:35] circuitlover: but I also think it's important to appreciate, that not all distributions do use systemd [14:35] then i will check the intricate details later, afte this class [14:35] it's covered in the chapter because the most (and most popular) distributions do [14:35] schubisu: yeah you're using void linux right [14:35] circuitlover: yes, which also does not use the old init.d [14:35] oh ok [14:36] The directory traversal should be blocked if the verybad service was not running as root. [14:36] so as you've learned last time, there are a lot of processes started on your machines, many of which you will start yourself as user [14:36] so it is like, running away from old init for systemd, now running away from systemd for other init systems :p [14:37] circuitlover: many people are quite happy with systemed, actually [14:37] the problem here is a bit different [14:37] is it not the case that most outside services shouldn't be running as root? surely? [14:37] schubisu: ok [14:38] ah you said after the session. [14:38] kiyo: it depends on your design ;) [14:38] sorry missed that, i will ask after the lesson. [14:38] kiyo: sure :) [14:39] so I guess there were many reasons to move away from init; when I started with Linux I think it's been Upstart that was used often [14:40] the key components are most probably speed, stability and security, followed by maintenance and monitoring capabilities [14:40] the init system is still the process with PID 1 on our system [14:41] so it does have quite some responsibility [14:42] kiyo, specbeck, circuitlover, mars; what are the service managers used on your distributions? [14:42] anyone using something different that systemd? [14:42] systemd [14:42] no, systemd only [14:42] How do I check? :P [14:42] specbeck: did you try any of the commands on your machine? [14:43] specbeck: like `systemctl status` [14:43] Yeah not working, so I assume I don't have systemd [14:43] specbeck: what distribution are you running? [14:43] Ubuntu on Windows [14:44] 20.01 [14:44] ah :) [14:44] do you have the `top` command? [14:45] Yes, it works [14:45] I would be interested to find out what is your PID 1 [14:46] or type `ps 1` [14:47] specbeck: let me know what is returned by that command once you know [14:47] something that is not covered in the chapter is actually the user space of systemd [14:47] try what services you will find when you type `systemctl --user status` [14:48] It shows /init [14:48] specbeck: can you try `ls -lah /init` ? [14:49] just for my curiosity ;) [14:49] I thought these things are broken on windows subsystem for linux [14:49] it might also matter if you are using wsl vs wsl2 [14:49] kiyo: I don't know, never tried it [14:49] schubisu: more less process as user compared to without user [14:49] it points to the root directory [14:50] specbeck: okay [14:50] circuitlover: not sure what you mean with more less process [14:50] https://stackoverflow.com/questions/55579342/why-systemd-is-disabled-in-wsl [14:50] for wsl, systemd is disabled on default (reading from internet) :) [14:50] circuitlover: okay [14:51] when I look at my --user processes, I e.g. find my pulseaudio.service and dbus.service [14:51] schubisu: i mean, what is i'm having right now, like notification daemon [14:51] schubisu: yes dbus for me too [14:51] but also some sensitive services like gpg-agent and gnome-keyring-daemon [14:52] so these are services that you as user without privileges can control. No sudo needed [14:52] similarly you can create new services in your --user space without any root permissions [14:52] the folder for those service files is usually located in "$HOME/.config/systemd/user/" [14:54] ! [14:54] I have my spotifyd.service file living there, as well as the espanso service, my text expander [14:54] next [14:54] sorry got my answer [14:55] maybe we can still hear the question [14:55] ok here it is [14:55] the term you mentioned service manger is also referring to systemd ? [14:56] its a dumb question :) forgot it [14:56] yes, the service manager is the process that runs as PID 1 and manages further processes [14:56] no stupid question [14:56] ok thankyou :) [14:56] any other questions anyone? [14:56] also regarding journalctl? [14:57] managing processes via systemd, like checking status, stopping, starting, enabling etc. will be something you might be doing on a daily basis [14:57] ok [14:57] ! [14:58] I'm not using systemd on my private machine, but still have to use it on any other server or VM I maintain [14:58] next [14:58] ! [14:58] regarding journalctl, is there anyother error logs we can use otherthan journalctl, since journalctl only logs the systemd services right ? [14:59] circuitlover: that does depend on the configuration of the individual processes [14:59] circuitlover: mostly, if there is another log maintained, you will find it somewhere in /var/log [15:00] ok,i should have read the fhs chapter :) [15:00] circuitlover: yes, please do that [15:00] next [15:01] I am looking through my logs [15:01] Is there any way to increace the log level? [15:01] I was hoping for more info on them. [15:01] kiyo: you mean chat logs or logs that journalctl maintains? [15:01] journalctl [15:02] kiyo: there are quite some configuration options there [15:02] also in terms of how big a log file it should keep ;) [15:02] maybe try `man journald.conf` to see some [15:03] by the way: kiyo, circuitlover, specbeck, mars I think we never explicitly spoke about man pages. Do you know how to use them? please anser yes or no [15:03] yes [15:03] yes [15:04] no [15:05] maybe just the quick basics: [15:06] if you have the `man-pages` package installed (and most distributions have by default) you can open the manual for a specific entry by typing `man ` [15:06] like `man journalctl` will open the man page for journalctl [15:07] navigation can be done with vim-like keybindings, use j to scroll down, k to scroll up, / to search, q to quit [15:07] very often you will find further readings to several topics that you can check out [15:08] and - what it very convenient - many packages also offer man pages not just for the binaries but for configuration files [15:08] that way you can look up the different options, attributes, etc. and how you can configure correctly [15:09] you basically have all documentation you need to look up Linux issues offline at hand [15:09] the more you learn to use the man pages, the quicker you will get your answers [15:09] you can start with `man man` to get an overview of some functions ;) [15:10] like `man -k journal` will list you all relevant man pages for the topic "journal" [15:10] okay, waiting another minute to see if there are any remaining questions [15:11] cool, will try this out [15:11] if that's not the case; next session should be on Monday, 29th. thanks, everyone [15:11] roll call [15:11] Robin Schubert [15:11] Saransh [15:11] mars [15:11] kiyo [15:11] Nagarajan [15:12] #endsession [15:12] ah, that's not it [15:12] Thanks for the calm and patient session, schubisu: ----END CLASS----