Systemctl daemon-reload after making changes to the sample.service file

Hello Team, while working on linux course in the " Service management with SYSTEMD" section and attempting the lab for lab:systemd services number 10 when adding Restart=always to the sample.service file after saving and exiting the file “wq!” and attempting to reload the service by typing the following:
sudo systemctl restart = it does not work
sudo systemctl daemon-reload = it says Too many arguments
sudo systemctl reload = does not work either

has anyone encounter this issue already and if yes, how you reload the services for the changes to be apply to the service?

Update on my own question:
I managed to find the issue, when running systemctl daemon-reload I did not have to include the unit file name “sample.service”.

I guess by only running systemctl daemon-reload, all of the service re-start without interruption

systemctl daemon-reload does not restart all the services.

It re-initializes the systemctl service itself - the service that manages all the other services.

It is necessary to run that command every time you create, edit or remove a unit file, because it makes the systemd daemon re-read all the unit files.

1 Like

not related to this question but why when I try to create a new partition using the following it does not work?

sudo gdisk /dev/vdb

In the interactive prompt, enter n

Select parition number = 1 (for vdd1 )

Select default first sector = 2048

Select +500M when asked for last sector

Use default hex code = 8300

Finally type w to write to the partition table

following this instructions and when checking it says task not completed with a red X

Probably better to raise an unrelated question as a new post.

1 Like

you’re right, definitely will do that next time!