Re: [systemd-devel] systemd: questions about dbus dependency service

2023-12-04 Thread Lennart Poettering
On Mo, 04.12.23 13:01, Pintu Agarwal (pintu.p...@gmail.com) wrote:

> Hi,
> Any comments or suggestions on the below ?

I already replied.

https://lists.freedesktop.org/archives/systemd-devel/2023-November/049706.html

Lennart

--
Lennart Poettering, Berlin


Re: [systemd-devel] systemd: questions about dbus dependency service

2023-12-03 Thread Pintu Agarwal
Hi,
Any comments or suggestions on the below ?

On Tue, 28 Nov 2023 at 22:48, Pintu Agarwal  wrote:
>
> Hi,
>
> I need some clarification about systemd services that are dependent on dbus 
> service.
>
> We have a service that depends on dbus.service, so our service has to be 
> started after dbus.socket and dbus.service.
> But dbus.service comes after local-fs.target and sysinit.target.
> However, our service needs to be started very early on boot-up, maybe within 
> local-fs target itself, otherwise it is causing regression in our boot KPI.
>
> How can we solve this issue in the most efficient way?
>
> We are using Linux Kernel 5.15 with arm64 and a high speed quad-core 
> processor.
> Also, the storage type is NAND with limited speed (12.5 MBPS).
> The filesystem is UBI + squashfs volumes.
>
> Thanks,
> Pintu


Re: [systemd-devel] systemd: questions about dbus dependency service

2023-11-28 Thread Lennart Poettering
On Di, 28.11.23 22:48, Pintu Agarwal (pintu.p...@gmail.com) wrote:

> Hi,
>
> I need some clarification about systemd services that are dependent on dbus
> service.
>
> We have a service that depends on dbus.service, so our service has to be
> started after dbus.socket and dbus.service.

It's usually a good idea to not wait for dbus.sevice. Waiting for
dbus.socket is sufficient, it makes sure clients can connect to D-Bus
(even if dbus needs to finish starting up to respond to it). This will
increase parallelization during boot.

> But dbus.service comes after local-fs.target and sysinit.target.
> However, our service needs to be started very early on boot-up, maybe
> within local-fs target itself, otherwise it is causing regression in our
> boot KPI.

dbus is not a suitable IPC for early boot services, unless you speak
the dbus protocol directly between client and service, without
involving the broker. But that's messy.

systemd's PID 1 does this (i.e. dbus without a broker), because it
must be accessible early on, but I hate that code, and I'd rather kill
it. In new code that must run in early boot we usually use a different
IPC (varlink), that does not involve any broker, and thus always works.

Lennart

--
Lennart Poettering, Berlin


Re: [systemd-devel] Systemd Questions

2016-08-14 Thread Che
On Sun, Aug 14, 2016 at 8:34 AM, Reindl Harald 
wrote:

>
> Am 14.08.2016 um 14:29 schrieb Tom Browder:
>

> 3. If Debian 8 is running systemd for a service, why do I need an
>> entry for a service in init.d?
>>
>
> you don't


If I'm not mistaken, systemd is still referenced in /etc/init.d in Debian
in some way, because systemd is still de facto transitional: and thus
continues to maintain backward compatibility with SysVinit. So many people
will probably not understand why systemd continues to be linked to various
parts of the old SysVinit system -- when it is supposed to be outright
replacing it.

Point is: it takes time to properly and safely transition core
infrastructure.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Systemd Questions

2016-08-14 Thread Reindl Harald



Am 14.08.2016 um 15:20 schrieb Tom Browder:

On Sun, Aug 14, 2016 at 7:34 AM, Reindl Harald  wrote:

to be honest: did you read *any* documentation or anything about systemd
before your post besides "it exists"?


Yes I did, a tutorial and man systemd. Have you ever looked at the man
page from the view point of a newbie?


surely, in 2011 as i had to convert the whole infrastructure to systemd 
with Fedora 15 or so i was a newbie too, finally there where way more 
native systemd-units in /et/systemd/system/ than Fedora itself shipped 
for years



There are no examples.  There
is no clear explanation of COMMAND from a user stand point (command
line operation), etc.  To be fair, I find most man pages are lacking
in real example of usage.


surely "man systemctl" - well, you need to know that command but it's a 
liltle bit unfair to criticize that because the knowledge how to 
start/stop services with sysvinit did also not fall from heacen



And the fact that Debian magically uses systemd even with an init.d
service file is misleading until you look closely at the script.


thats the compatibility layer of systemd where a generator creates a 
on-the-fly unit at boot - that prevents you from dealing with 2 
different ways of stop/start services where you would need to look which 
type it is



I did go to the systemd home page and got a bit farther, but it still
looks like a painful dig from here (I need a "Systemd for Dummies!")


if you would have spent 10 seconds you have found dozens
https://www.google.com/search?q=systemd+for+newbies

https://www.linux.com/learn/managing-services-linux-systemd
http://www.catchlinux.com/what-is-systemd-for-noobs/



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Systemd Questions

2016-08-14 Thread Tom Browder
On Sunday, August 14, 2016, Mantas Mikulėnas  wrote:
...

Thank you for all the info, Mantas--very helpful!

Best regards,

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


Re: [systemd-devel] Systemd Questions

2016-08-14 Thread Mantas Mikulėnas
On Sun, Aug 14, 2016 at 3:29 PM, Tom Browder  wrote:

> I am trying to get comfortable with systemd on Debian 8 but am very
> confused by the complex documentation.
>
> I am a simple man with a simple need to be able to modiify startup
> scripts for several packages I build from source which currently are:
>
> + apache (httpd)
> + postgresql
> + bind9
>
> I'm not sure of a few things under systemd:
>
> 1. What exactly is the command to start or stop a service (consider
> the three above)?
>

With native systemd .services, it's taken from the unit's ExecStart= and
ExecStop= (the default for the latter is SIGTERM).

SysV-compat services (see below) just run "/etc/init.d/httpd start", so
everything works as before.

In either case, `systemctl status …` shows the command that was used.

2. Where exactly do I modify starting, status, and stopping parameters
> for a service?
>

With native systemd .services, either use `systemctl edit [--full]`, or
manually copy the .service file to /etc/systemd/system and edit it there
(use `systemctl daemon-reload` afterwards).

With SysV-compat services, either edit the old initscript in /etc/init.d/
(as before), or write a native .service from scratch.


> 3. If Debian 8 is running systemd for a service, why do I need an
> entry for a service in init.d?
>

You don't – it's just that many Debian packages haven't been ported to
systemd yet, therefore systemd still uses the "SysV compatibility" mode for
them (which generates dummy .services with "/etc/init.d/whatever start").


> 4. Do I have to use systemd for a service?  If not, how do I do that?
>

You should. The SysV compat mode had to sacrifice some basic functionality
(like knowing whether the daemon is still running...) in order to still
work with all the weird init.d scripts out there. If nothing else, writing
a native .service might be useful both to learn systemd and to avoid the
several layers of indirection.

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


Re: [systemd-devel] Systemd Questions

2016-08-14 Thread Mantas Mikulėnas
On Sun, Aug 14, 2016 at 5:30 PM, Mantas Mikulėnas  wrote:

> On Sun, Aug 14, 2016 at 3:29 PM, Tom Browder 
> wrote:
>
>> I am trying to get comfortable with systemd on Debian 8 but am very
>> confused by the complex documentation.
>>
>> I am a simple man with a simple need to be able to modiify startup
>> scripts for several packages I build from source which currently are:
>>
>> + apache (httpd)
>> + postgresql
>> + bind9
>>
>> I'm not sure of a few things under systemd:
>>
>> 1. What exactly is the command to start or stop a service (consider
>> the three above)?
>>
>
> With native systemd .services, it's taken from the unit's ExecStart= and
> ExecStop= (the default for the latter is SIGTERM).
>
> SysV-compat services (see below) just run "/etc/init.d/httpd start", so
> everything works as before.
>
> In either case, `systemctl status …` shows the command that was used.
>

The above was thinking you were asking about what command systemd *itself*
uses to run the daemon... The user-facing commands are `systemctl start
httpd` or `service httpd start` (both should do the same thing).

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


Re: [systemd-devel] Systemd Questions

2016-08-14 Thread Reindl Harald



Am 14.08.2016 um 14:29 schrieb Tom Browder:

I am trying to get comfortable with systemd on Debian 8 but am very
confused by the complex documentation.

I am a simple man with a simple need to be able to modiify startup
scripts for several packages I build from source which currently are:

+ apache (httpd)
+ postgresql
+ bind9

I'm not sure of a few things under systemd:

1. What exactly is the command to start or stop a service (consider
the three above)?


systemctl start servicename
systemctl stop servicename


2. Where exactly do I modify starting, status, and stopping parameters
for a service?


/etc/systemd/system/


3. If Debian 8 is running systemd for a service, why do I need an
entry for a service in init.d?


you don't


4. Do I have to use systemd for a service?  If not, how do I do that?


to be honest: did you read *any* documentation or anything about systemd 
before your post besides "it exists"?




signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel