systemctl daemon-reload in SysVinit (to avoid reboot)  [Solved]

Help with the version of MX KDE officially released by the Development Team.
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
MarieSophie
Posts: 109
Joined: Mon Jun 24, 2024 10:39 am

systemctl daemon-reload in SysVinit (to avoid reboot)

#1 Post by MarieSophie »

Hello,
Each time I edit my /etc/fstab, I have to reboot ('cause IDK better)
On systemD, there is the CL systemctl daemon-reload
I've search and found what is STB the equivalent for SysVinit:
systemctl daemon-reload ------------------------ chkconfig fooserv --add
on a forum post from 2011

But MX23 says it doesn't recognize the cmd "chkconfig"
Is it deprecated, or should I add something to it or install some to run it ?
Or am I to "just" reboot after each change ?
Retired: T21, T22, T42p, T61p,
Running: W700DS Suse; T440p MX23.5; P15.gen2 Qubes/Win10

User avatar
DukeComposed
Posts: 1506
Joined: Thu Mar 16, 2023 1:57 pm

Re: systemctl daemon-reload in SysVinit (to avoid reboot)

#2 Post by DukeComposed »

MarieSophie wrote: Fri Jul 12, 2024 3:41 am Hello,
Each time I edit my /etc/fstab, I have to reboot ('cause IDK better)
Try sudo mount -a.

MarieSophie
Posts: 109
Joined: Mon Jun 24, 2024 10:39 am

Re: systemctl daemon-reload in SysVinit (to avoid reboot)

#3 Post by MarieSophie »

TY,
But mount -a will mount any swap in the fstab,which is not reloaded, I think you my have missed the point
Retired: T21, T22, T42p, T61p,
Running: W700DS Suse; T440p MX23.5; P15.gen2 Qubes/Win10

User avatar
DukeComposed
Posts: 1506
Joined: Thu Mar 16, 2023 1:57 pm

Re: systemctl daemon-reload in SysVinit (to avoid reboot)

#4 Post by DukeComposed »

MarieSophie wrote: Mon Jul 15, 2024 7:40 am But mount -a will mount any swap in the fstab,which is not reloaded, I think you my have missed the point
You never mentioned concerns about swap files in the original post. What would I have missed?

User avatar
dolphin_oracle
Developer
Posts: 22713
Joined: Sun Dec 16, 2007 12:17 pm

Re: systemctl daemon-reload in SysVinit (to avoid reboot)

#5 Post by dolphin_oracle »

if you want your mounted conditions to match what is in your fstab, under sysVinit, you would manually do this with mount and umount commands.

If you need to deactivate swap, "swapoff $DEVICENAME" would be the command. activate swap with "swapon $DEVICENAME"
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

MarieSophie
Posts: 109
Joined: Mon Jun 24, 2024 10:39 am

Re: systemctl daemon-reload in SysVinit (to avoid reboot)

#6 Post by MarieSophie »

DukeComposed wrote: Mon Jul 15, 2024 8:07 am
MarieSophie wrote: Mon Jul 15, 2024 7:40 am But mount -a will mount any swap in the fstab,which is not reloaded, I think you my have missed the point
You never mentioned concerns about swap files in the original post. What would I have missed?
Indeed, I didn't, and while re-reading this short (luckily) thread I recon I answered to quickly (for a change).
Yes, the mount -a will (re)mount the complete fstab, that should be enough for this part,

But the original question is about the command

Code: Select all

systemctl daemon-reload ------------------------ chkconfig fooserv --add 
and I realize that I don't even "exactly" know what this cmd do and do not.

Is this command only mounting and therefore the exact same as mount -a, or does it stop/restart some systems, which then "mount -a" doesn't do ?
Retired: T21, T22, T42p, T61p,
Running: W700DS Suse; T440p MX23.5; P15.gen2 Qubes/Win10

User avatar
CharlesV
Administrator
Posts: 8028
Joined: Sun Jul 07, 2019 5:11 pm

Re: systemctl daemon-reload in SysVinit (to avoid reboot)

#7 Post by CharlesV »

man systemctl says:
daemon-reload

Reload systemd manager configuration. This will rerun all generators (see systemd.generator(7)), reload all unit files, and recreate the entire dependency tree. While the daemon is being reloaded, all sockets systemd listens on behalf of user configuration will stay accessible.

This command should not be confused with the reload command.


So, it's a "soft" reload, essentially; taking changed configurations from filesystem and regenerating dependency trees.

Consequently, systemd.generator states:

Generators are small binaries that live in /usr/lib/systemd/user-generators/ and other directories listed above. systemd(1) will execute those binaries very early at bootup and at configuration reload time — before unit files are loaded. Generators can dynamically generate unit files or create symbolic links to unit files to add additional dependencies, thus extending or overriding existing definitions. Their main purpose is to convert configuration files that are not native unit files dynamically into native unit files.

Generators are loaded from a set of paths determined during compilation, listed above. System and user generators are loaded from directories with names ending in system-generators/ and user-generators/, respectively. Generators found in directories listed earlier override the ones with the same name in directories lower in the list. A symlink to /dev/null or an empty file can be used to mask a generator, thereby preventing it from running. Please note that the order of the two directories with the highest priority is reversed with respect to the unit load path and generators in /run overwrite those in /etc.

After installing new generators or updating the configuration, systemctl daemon-reload may be executed. This will delete the previous configuration created by generators, re-run all generators, and cause systemd to reload units from disk. See systemctl(1) for more information.


AS I read this, it appears it does FAR more than 'just remount" .. it checks for changes in configs, and variants from "regneration og binaries" too !
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

User avatar
CharlesV
Administrator
Posts: 8028
Joined: Sun Jul 07, 2019 5:11 pm

Re: systemctl daemon-reload in SysVinit (to avoid reboot)

#8 Post by CharlesV »

Specifying the 'daemon-reload' ... means it removes cache and starts that process all over again. This was one of the big deals, because under sysvinit you need to clear some cache in some instances. Not sure this is one of those, but the theory is the same as I understand it.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

User avatar
fehlix
Developer
Posts: 12900
Joined: Wed Apr 11, 2018 5:09 pm

Re: systemctl daemon-reload in SysVinit (to avoid reboot)  [Solved]

#9 Post by fehlix »

MarieSophie wrote: Mon Jul 22, 2024 3:48 pm Is this command only mounting and therefore the exact same as mount -a, or does it stop/restart some systems, which then "mount -a" doesn't do ?
If you have only changed the /etc/fstab and when you run systemd as init systemd,
systemd would normally detect the changes made,
In doubt you can tell systemd to check for changes with

Code: Select all

sudo systemctl daemon-reload 
It will re-read any changes made in rgrd to systemd "daemon" services
including the /etc/fstab and trigger to generated and run mount-services for the entries found,
So yes "mount -a" can be done when running systemd with "sudo systemctl daemon-reload",
b/c systemd invented a new method to mount partitions with services.

Post Reply

Return to “MX KDE Official Release”