Re: [systemd-devel] starting a service before anything else....

2018-07-02 Thread MALET Jean-Luc



Le 28/06/2018 à 17:02, Reindl Harald a écrit :

Am 28.06.2018 um 16:55 schrieb MALET Jean-Luc:

I'm in charge of setting up an embedded solution based on debian, so on
systemd, I'm more used to old init process, that was easy to tweak
because based on script... but well... times seems now on systemd.

I'm really puzzled because since the documentation seems to lack
information, I have to find information on tutorials that focus only on
late services..

I found on one how to find the targets using "systemctl list-units
--type=target" and some diagram explaining what target are suposed to be
run in what order but well...

my issue is that I've to run a script as early as possible, before
mounts are done because lot of service will fail without , so I created
a service

[Unit]
Description=mount some file systems before anything and prepare the system
Before=systemd-remount-fs.service

+ DefaultDependencies=no

ok this seems to do the trick
it could be nice to have some documentation that explain what are the 
DefaultDependencies I hate that someone choose to do something for 
me without beeing aware of it at least when enabling a service 
display it's Dependencies...
it's just my point of view, but for me, what isn't in the service file 
shouldn't be executed... when I ask a coffee, I don't want that charge 
me a sweet in addition

thanks for the reply

[Service]
Type=oneshot
ExecStart=/etc/init.d/setup.sh start


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] starting a service before anything else....

2018-06-28 Thread MALET Jean-Luc

Hi!

I'm in charge of setting up an embedded solution based on debian, so on 
systemd, I'm more used to old init process, that was easy to tweak 
because based on script... but well... times seems now on systemd.


I'm really puzzled because since the documentation seems to lack 
information, I have to find information on tutorials that focus only on 
late services..


I found on one how to find the targets using "systemctl list-units 
--type=target" and some diagram explaining what target are suposed to be 
run in what order but well...


my issue is that I've to run a script as early as possible, before 
mounts are done because lot of service will fail without , so I created 
a service



[Unit]
Description=mount some file systems before anything and prepare the system
Before=systemd-remount-fs.service

[Service]
Type=oneshot
ExecStart=/etc/init.d/setup.sh start

[Install]
WantedBy=swap.target


using journalctl I found that the first Reached point was the 
swap.target so it looked like a good WantedBy, but looking at the 
journalctl showed that the service was still not run in early systemd 
steps... so I added a Before rule using the "systemctl list-units 
--type=service" to guess what service where run on the system... and 
well... it's not working as expected... I still see my service run after 
some other services...


on sysV init, it was easy to track down what would be run and assign 
order... here I'm puzzled because there are only partial information 
from tutorials and it's not clear what will be run, what is the entry 
point target, how to list the dependencies since some are hidden and 
built in...


so can you help me? how can I run my service (before it was run in rcS 
script, so that we were sure that it was the first thing done)


thanks

JLM

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel