Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Chad

On 6/23/2015 10:35 PM, killermoehre wrote:

Am 24.06.2015 um 02:00 schrieb Chad:

On 6/23/2015 4:45 PM, Ronny Chevalier wrote:

On Wed, Jun 24, 2015 at 1:37 AM, Chad  wrote:

Oh, wait this is the reverse of what I want/need (systemd-sysv-generator
goes from init.d to systemd, I need from systemd to init.d).
I have a nagios script that runs something like:
/etc/init.d/httpd status
It then reads the output and makes sure httpd is running, if not it
takes
action depending on the service.
I use that method for tons of services.
I don't want to have to re-write the modules to use:
systemctl status httpd
If I did that then I will not be able to rsync the scripts/configs
around
and would have to maintain 2 versions of the code.
I was wondering if there was an easy way to create a /etc/init.d/httpd
script that called something like this inside:
#!/bin/bash
systemctl $1 $0
I know it is not that simple ($0 for example is the full path
/etc/init.d/httpd not just the httpd), which is why I am hoping there
is a
tool for this.


If you just want to know if a service is active you can use:

systemctl is-active httpd

If $? equals 0 then the service is active, else it is not :)

If you make your script use this I don't see why you would have to
maintain multiple versions, if your intention is to use systemd
everywhere.

Except that I can not convert all servers I maintain over just like
that, it will take time, probably 1-2 years.

As to: systemctl is-active httpd, that would work sometimes but not
others. For example I check fail2ban by running /etc/init.d/iptables
status which outputs all the firewall rules then check that output to
make sure the chains for fail2ban are there. If you restart iptables
without restarting fail2ban, fail2ban will show as running because the
daemon is up, but since the chains are gone it can not ban bad guys.

Maybe one of you knows a solution to that (iptables restart without a
fail2ban restart), I have not found one for init.d, is this fixed
somehow in systemd?
That would be another advantage.

^C

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

Hi Chad,

why don't make a dependency between iptables and fail2ban? This is really easy 
in systemd with Requires and Wants entries in the services. So you can't 
restart iptables without automatic trigger of a fail2ban restart.

Regards

Killermoehre,
Thank you for your time and reply.

I intend to do exactly that when I start using systemd (I am still using init.d at the moment). In fact I have already 
suggested that very thing on the fail2ban mailing list so that can add it to the tree and no custom rule is needed. To 
my knowlage there is not a built in/standard way to tie init.d/iptables to init.d/fail2ban.


The test for the chains existence is still needed in case the chain is removed by other means (like a manual delete from 
the cli).
I have found that I can trust nothing and that I should check/test everything :) when I think something is impossible or 
so unlikely that it will "never happen to me" it inevitably is a problem at the worst possible moment. I bet some of you 
know what I mean.


^C


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


Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread killermoehre
Am 24.06.2015 um 02:00 schrieb Chad:
> On 6/23/2015 4:45 PM, Ronny Chevalier wrote:
> > On Wed, Jun 24, 2015 at 1:37 AM, Chad  wrote:
> >> Oh, wait this is the reverse of what I want/need (systemd-sysv-generator
> >> goes from init.d to systemd, I need from systemd to init.d).
> >> I have a nagios script that runs something like:
> >> /etc/init.d/httpd status
> >> It then reads the output and makes sure httpd is running, if not it
> >> takes
> >> action depending on the service.
> >> I use that method for tons of services.
> >> I don't want to have to re-write the modules to use:
> >> systemctl status httpd
> >> If I did that then I will not be able to rsync the scripts/configs
> >> around
> >> and would have to maintain 2 versions of the code.
> >> I was wondering if there was an easy way to create a /etc/init.d/httpd
> >> script that called something like this inside:
> >> #!/bin/bash
> >> systemctl $1 $0
> >> I know it is not that simple ($0 for example is the full path
> >> /etc/init.d/httpd not just the httpd), which is why I am hoping there
> >> is a
> >> tool for this.
> >>
> > If you just want to know if a service is active you can use:
> >
> > systemctl is-active httpd
> >
> > If $? equals 0 then the service is active, else it is not :)
> >
> > If you make your script use this I don't see why you would have to
> > maintain multiple versions, if your intention is to use systemd
> > everywhere.
> Except that I can not convert all servers I maintain over just like
> that, it will take time, probably 1-2 years.
>
> As to: systemctl is-active httpd, that would work sometimes but not
> others. For example I check fail2ban by running /etc/init.d/iptables
> status which outputs all the firewall rules then check that output to
> make sure the chains for fail2ban are there. If you restart iptables
> without restarting fail2ban, fail2ban will show as running because the
> daemon is up, but since the chains are gone it can not ban bad guys.
>
> Maybe one of you knows a solution to that (iptables restart without a
> fail2ban restart), I have not found one for init.d, is this fixed
> somehow in systemd?
> That would be another advantage.
>
> ^C
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Hi Chad,

why don't make a dependency between iptables and fail2ban? This is really easy 
in systemd with Requires and Wants entries in the services. So you can't 
restart iptables without automatic trigger of a fail2ban restart.

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


Re: [systemd-devel] [PATCH] ata_id: unbotch format specifier

2015-06-23 Thread Kay Sievers
On Wed, Jun 24, 2015 at 1:48 AM, Jan Engelhardt  wrote:
> Commit v218-247-g11c6f69 broke the output of the utility. "%1$" PRIu64
> "x" expands to "%1$lux", essentially "%lux", which shows the problem.
> u and x cannot be combined, u wins as the type character, and x gets
> emitted verbatim to stdout.
>
> References: https://bugzilla.redhat.com/show_bug.cgi?id=1227503
> ---
>  src/udev/ata_id/ata_id.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c
> index cc1bf45..7ba0b7f 100644
> --- a/src/udev/ata_id/ata_id.c
> +++ b/src/udev/ata_id/ata_id.c
> @@ -639,8 +639,8 @@ int main(int argc, char *argv[])
>   */
>  word = identify.wyde[108];
>  if ((word & 0xf000) == 0x5000)
> -printf("ID_WWN=0x%1$"PRIu64"x\n"
> -   "ID_WWN_WITH_EXTENSION=0x%1$"PRIu64"x\n",
> +printf("ID_WWN=0x%1$" PRIx64 "\n"
> +   "ID_WWN_WITH_EXTENSION=0x%1$" PRIx64 "\n",

Modern isn't always better. :) Applied.

Thanks,
Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] ata_id: unbotch format specifier

2015-06-23 Thread systemd github import bot
Patchset imported to github.
To create a pull request, one of the main developers has to initiate one via:


--
Generated by https://github.com/haraldh/mail2git
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Chad

On 6/23/2015 4:45 PM, Ronny Chevalier wrote:

On Wed, Jun 24, 2015 at 1:37 AM, Chad  wrote:

Oh, wait this is the reverse of what I want/need (systemd-sysv-generator
goes from init.d to systemd, I need from systemd to init.d).
I have a nagios script that runs something like:
/etc/init.d/httpd status
It then reads the output and makes sure httpd is running, if not it takes
action depending on the service.
I use that method for tons of services.
I don't want to have to re-write the modules to use:
systemctl status httpd
If I did that then I will not be able to rsync the scripts/configs around
and would have to maintain 2 versions of the code.
I was wondering if there was an easy way to create a /etc/init.d/httpd
script that called something like this inside:
#!/bin/bash
systemctl $1 $0
I know it is not that simple ($0 for example is the full path
/etc/init.d/httpd not just the httpd), which is why I am hoping there is a
tool for this.


If you just want to know if a service is active you can use:

systemctl is-active httpd

If $? equals 0 then the service is active, else it is not :)

If you make your script use this I don't see why you would have to
maintain multiple versions, if your intention is to use systemd
everywhere.

Except that I can not convert all servers I maintain over just like that, it 
will take time, probably 1-2 years.

As to: systemctl is-active httpd, that would work sometimes but not others. For example I check fail2ban by running 
/etc/init.d/iptables status which outputs all the firewall rules then check that output to make sure the chains for 
fail2ban are there. If you restart iptables without restarting fail2ban, fail2ban will show as running because the 
daemon is up, but since the chains are gone it can not ban bad guys.


Maybe one of you knows a solution to that (iptables restart without a fail2ban restart), I have not found one for 
init.d, is this fixed somehow in systemd?

That would be another advantage.

^C

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


[systemd-devel] [PATCH] ata_id: unbotch format specifier

2015-06-23 Thread Jan Engelhardt
Commit v218-247-g11c6f69 broke the output of the utility. "%1$" PRIu64
"x" expands to "%1$lux", essentially "%lux", which shows the problem.
u and x cannot be combined, u wins as the type character, and x gets
emitted verbatim to stdout.

References: https://bugzilla.redhat.com/show_bug.cgi?id=1227503
---
 src/udev/ata_id/ata_id.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c
index cc1bf45..7ba0b7f 100644
--- a/src/udev/ata_id/ata_id.c
+++ b/src/udev/ata_id/ata_id.c
@@ -639,8 +639,8 @@ int main(int argc, char *argv[])
  */
 word = identify.wyde[108];
 if ((word & 0xf000) == 0x5000)
-printf("ID_WWN=0x%1$"PRIu64"x\n"
-   "ID_WWN_WITH_EXTENSION=0x%1$"PRIu64"x\n",
+printf("ID_WWN=0x%1$" PRIx64 "\n"
+   "ID_WWN_WITH_EXTENSION=0x%1$" PRIx64 "\n",
identify.octa[108/4]);
 
 /* from Linux's include/linux/ata.h */
-- 
2.4.3

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


Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Ronny Chevalier
On Wed, Jun 24, 2015 at 1:37 AM, Chad  wrote:
> Oh, wait this is the reverse of what I want/need (systemd-sysv-generator
> goes from init.d to systemd, I need from systemd to init.d).
> I have a nagios script that runs something like:
> /etc/init.d/httpd status
> It then reads the output and makes sure httpd is running, if not it takes
> action depending on the service.
> I use that method for tons of services.
> I don't want to have to re-write the modules to use:
> systemctl status httpd
> If I did that then I will not be able to rsync the scripts/configs around
> and would have to maintain 2 versions of the code.
> I was wondering if there was an easy way to create a /etc/init.d/httpd
> script that called something like this inside:
> #!/bin/bash
> systemctl $1 $0
> I know it is not that simple ($0 for example is the full path
> /etc/init.d/httpd not just the httpd), which is why I am hoping there is a
> tool for this.
>

If you just want to know if a service is active you can use:

systemctl is-active httpd

If $? equals 0 then the service is active, else it is not :)

If you make your script use this I don't see why you would have to
maintain multiple versions, if your intention is to use systemd
everywhere.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Chad

On 6/23/2015 4:26 PM, Reindl Harald wrote:


Am 24.06.2015 um 01:07 schrieb Chad:

You could do something like:

systemctl start htt
systemctl st

or else, and it will complete it.

I use bash. This is a cool trick that systemd has over init.d. I know
not all programs can do that shell completion, for example
/etc/init.d/httpd res does not work (I try it all the time out of
tab completion habit!)


not true, that's just because you don't use the correct command and call a script which is not known to 
bash-completion directly


[root@honeypot:~]$ service honeypot
restart  startstatus   stop
[root@honeypot:~]$ service honeypot ^C
[root@honeypot:~]$ cat /etc/redhat-release
CentOS release 6.6 (Final)

Name: bash-completion
Arch: noarch
Epoch   : 1
Version : 1.3
Release : 7.el6
Size: 576 k
Repo: installed
Summary : Programmable completion for Bash
URL: http://bash-completion.alioth.debian.org/
License : GPLv2+
Beschreibung : bash-completion is a collection of shell functions that take 
advantage
 : of the programmable completion feature of bash.

[root@honeypot:~]$ rpm -q --file /etc/bash_completion.d/service
bash-completion-1.3-7.el6.noarch



Mr. Harald,
Thanks again for your reply, I did not have bash-completion installed (and did 
not know it existed).
I installed it on one of the servers and sure enough res completes to 
"restart" now!
Cool, I will be adding that to all my servers and to my new server set-up 
scripts and notes.
Super awesome feature!

^C

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


Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Chad


On 6/23/2015 4:25 PM, Ronny Chevalier wrote:

On Wed, Jun 24, 2015 at 1:07 AM, Chad  wrote:

Mr. Chevalier,
Thank you for your time and reply.

On 6/23/2015 1:30 PM, Ronny Chevalier wrote:

On Tue, Jun 23, 2015 at 9:45 PM, Chad  wrote:

I am sure this is the wrong place to send this e-mail, but I could not
find
another place to send it.

Hi,

It is the good place :)

Great, thanks.


I want to learn and use systemd, but have run into a few problems on my
way.
Please don't see this as an attack on systemd, I want to learn something
new, but change is hard.

I am an old school kind of sysadmin and I am planning on moving from
CentOS
6 to CentOS 7, but I am having trouble with systemd. I am hoping you know
some shortcuts/tricks to help me learn the new way.

#
1. I can't spell. With init I don't have to know how to spell things
because
I have tab complete. I use tab complete for almost every command I type.
For
example:
/e gets -> /etc/
/etc/in  gets -> /etc/init
/etc/init.  gets -> /etc/init.d/
/etc/init.d/ht /etc/init.d/httpd
/etc/init.d/httpd restart
So I entered 19 characters and got 25 with tab complete.

The new systemd way would be to type (23 total characters, no tab
complete):
systemctl restart httpd
Maybe I could tab complete systemctl, but I don't currently have a CentOS
7
system to test on.

The real issue is that I have to know (in the above example) that it is
httpd not http.
With so many systems, distros, and services it is hard to remember every
service name exactly (and some names are very long). For example ntpd has
a
d, but nfs does not.
Tab completion fixes this issue for me.

How can I use tab completion with systemd?

If you use either bash or zsh, systemd provides shell completion for them.

You could do something like:

systemctl start htt
systemctl st

or else, and it will complete it.

I use bash. This is a cool trick that systemd has over init.d. I know not
all programs can do that shell completion, for example /etc/init.d/httpd
res does not work (I try it all the time out of tab completion habit!).



#
2. How to find all possible services:

The init way:
ls -l /etc/init/d

The systemd way:
ls -l /lib/systemd/system/*.service /etc/systemd/system/*.service

This seems WAY harder and I have to remember 2 locations instead of 1.

There is:

systemctl list-unit-files

It lists all the units installed on your system. In systemd a unit is
a configuration file that can describe a service, a mount point, a
device,... So a service is a subtype of unit, see "man 5 systemd.unit"
for more information.

So if you want to only display the services, you just have to specify the
type

systemctl list-unit-files --type=service

Ok, so that is a lot more to remember than ls -l /etc/init.d, but I can
learn it.



#
3. List all services and their start levels:


In systemd world, start levels equivalent are the targets (see man 5
systemd.target). A target is a synchronisation point between multiple
units. For example, there is sysinit.target which is the
synchronization point for early boot services. This way a unit can ask
to be started only after a specific target, for example.


The init way (all services):
chkconfig --list

The init way (only active services. I use this a lot):
chkconfig --list | grep :on

The systemd way (all services):
systemctl list-unit-files --type=service

The systemd way (only active services, I don't know how to do this).
systemctl ???


With systemctl you can provide a filter according to the current state
of a unit. If you want to list all the active service, you can do:

systemctl --state=active --type=service list-units

Ok, again more to type and remember, but memorization is not out of the
question.



#
4. What about the many programs that rely on /etc/init.d/
status/start/stop/restart
I have many services that are monitored by nagios or cron jobs (like
logrotate) that rely on /etc/init.d/ status/start/stop/restart.
I don't want to change them because right now they work on every server
and
I don't want to have to maintain 2 versions of the code or hunt them all
down.

There is systemd-sysv-generator which creates wrapper .service for
sysv scripts automatically at boot. But you need to specify additional
headers if you want to use ordering. See man systemd-sysv-generator.

That is what I am looking for (systemd-sysv-generator), but does that mean
systemd will not use the .service files and the system will go back to
running all start-up scripts in order via init.d style S01-S99?
I don't really care that much as boot time does not matter (I rarely reboot
and always have a secondary server that can take the load. I run all
clusters or active/backup.)

No, systemd-sysv-generator will read init scripts and generates
equivalent services (a systemd unit). Then systemd will load this
services like it loads every other units and infer what needs to be
started first according to the configuration in the units. The
priority of the S01-S99 is also respected, u

Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Reindl Harald


Am 24.06.2015 um 01:07 schrieb Chad:

You could do something like:

systemctl start htt
systemctl st

or else, and it will complete it.

I use bash. This is a cool trick that systemd has over init.d. I know
not all programs can do that shell completion, for example
/etc/init.d/httpd res does not work (I try it all the time out of
tab completion habit!)


not true, that's just because you don't use the correct command and call 
a script which is not known to bash-completion directly


[root@honeypot:~]$ service honeypot
restart  startstatus   stop
[root@honeypot:~]$ service honeypot ^C
[root@honeypot:~]$ cat /etc/redhat-release
CentOS release 6.6 (Final)

Name: bash-completion
Arch: noarch
Epoch   : 1
Version : 1.3
Release : 7.el6
Size: 576 k
Repo: installed
Summary : Programmable completion for Bash
URL: http://bash-completion.alioth.debian.org/
License : GPLv2+
Beschreibung : bash-completion is a collection of shell functions that 
take advantage

 : of the programmable completion feature of bash.

[root@honeypot:~]$ rpm -q --file /etc/bash_completion.d/service
bash-completion-1.3-7.el6.noarch




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


Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Reindl Harald



Am 23.06.2015 um 21:45 schrieb Chad:

The new systemd way would be to type (23 total characters, no tab
complete):
systemctl restart httpd
Maybe I could tab complete systemctl, but I don't currently have a
CentOS 7 system to test on.


maybe you should just install CentOS inside a VM and test it

[root@srv-rhsoft:~]$ systemctl restart h
halt-local.service   haveged.service 
home.mount   hostapd-guest.service 
httpd-lounge-worker.service  hybrid-sleep.target
halt.target  hibernate.target 
hostapd-guest-interface.service  hostapd.service 
httpd.service




The real issue is that I have to know (in the above example) that it is
httpd not http.
With so many systems, distros, and services it is hard to remember every
service name exactly (and some names are very long). For example ntpd
has a d, but nfs does not.
Tab completion fixes this issue for me.

How can I use tab completion with systemd?


as like for any other software - hit the TAB key


#
2. How to find all possible services:

The init way:
ls -l /etc/init/d

The systemd way:
ls -l /lib/systemd/system/*.service /etc/systemd/system/*.service

This seems WAY harder and I have to remember 2 locations instead of 1


nobody but you installs systemd-units in /etc/ and so you have only one 
location AND customized ones - with sysvinit you had no way to override 
/etc/init.d/httpd without doing the work after each update again




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


Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Ronny Chevalier
On Wed, Jun 24, 2015 at 1:07 AM, Chad  wrote:
> Mr. Chevalier,
> Thank you for your time and reply.
>
> On 6/23/2015 1:30 PM, Ronny Chevalier wrote:
>>
>> On Tue, Jun 23, 2015 at 9:45 PM, Chad  wrote:
>>>
>>> I am sure this is the wrong place to send this e-mail, but I could not
>>> find
>>> another place to send it.
>>
>> Hi,
>>
>> It is the good place :)
>
> Great, thanks.
>
>>> I want to learn and use systemd, but have run into a few problems on my
>>> way.
>>> Please don't see this as an attack on systemd, I want to learn something
>>> new, but change is hard.
>>>
>>> I am an old school kind of sysadmin and I am planning on moving from
>>> CentOS
>>> 6 to CentOS 7, but I am having trouble with systemd. I am hoping you know
>>> some shortcuts/tricks to help me learn the new way.
>>>
>>> #
>>> 1. I can't spell. With init I don't have to know how to spell things
>>> because
>>> I have tab complete. I use tab complete for almost every command I type.
>>> For
>>> example:
>>> /e gets -> /etc/
>>> /etc/in  gets -> /etc/init
>>> /etc/init.  gets -> /etc/init.d/
>>> /etc/init.d/ht /etc/init.d/httpd
>>> /etc/init.d/httpd restart
>>> So I entered 19 characters and got 25 with tab complete.
>>>
>>> The new systemd way would be to type (23 total characters, no tab
>>> complete):
>>> systemctl restart httpd
>>> Maybe I could tab complete systemctl, but I don't currently have a CentOS
>>> 7
>>> system to test on.
>>>
>>> The real issue is that I have to know (in the above example) that it is
>>> httpd not http.
>>> With so many systems, distros, and services it is hard to remember every
>>> service name exactly (and some names are very long). For example ntpd has
>>> a
>>> d, but nfs does not.
>>> Tab completion fixes this issue for me.
>>>
>>> How can I use tab completion with systemd?
>>
>> If you use either bash or zsh, systemd provides shell completion for them.
>>
>> You could do something like:
>>
>> systemctl start htt
>> systemctl st
>>
>> or else, and it will complete it.
>
> I use bash. This is a cool trick that systemd has over init.d. I know not
> all programs can do that shell completion, for example /etc/init.d/httpd
> res does not work (I try it all the time out of tab completion habit!).
>>
>>
>>>
>>> #
>>> 2. How to find all possible services:
>>>
>>> The init way:
>>> ls -l /etc/init/d
>>>
>>> The systemd way:
>>> ls -l /lib/systemd/system/*.service /etc/systemd/system/*.service
>>>
>>> This seems WAY harder and I have to remember 2 locations instead of 1.
>>
>> There is:
>>
>> systemctl list-unit-files
>>
>> It lists all the units installed on your system. In systemd a unit is
>> a configuration file that can describe a service, a mount point, a
>> device,... So a service is a subtype of unit, see "man 5 systemd.unit"
>> for more information.
>>
>> So if you want to only display the services, you just have to specify the
>> type
>>
>> systemctl list-unit-files --type=service
>
> Ok, so that is a lot more to remember than ls -l /etc/init.d, but I can
> learn it.
>>
>>
>>> #
>>> 3. List all services and their start levels:
>>>
>> In systemd world, start levels equivalent are the targets (see man 5
>> systemd.target). A target is a synchronisation point between multiple
>> units. For example, there is sysinit.target which is the
>> synchronization point for early boot services. This way a unit can ask
>> to be started only after a specific target, for example.
>>
>>> The init way (all services):
>>> chkconfig --list
>>>
>>> The init way (only active services. I use this a lot):
>>> chkconfig --list | grep :on
>>>
>>> The systemd way (all services):
>>> systemctl list-unit-files --type=service
>>>
>>> The systemd way (only active services, I don't know how to do this).
>>> systemctl ???
>>>
>> With systemctl you can provide a filter according to the current state
>> of a unit. If you want to list all the active service, you can do:
>>
>> systemctl --state=active --type=service list-units
>
> Ok, again more to type and remember, but memorization is not out of the
> question.
>>
>>
>>> #
>>> 4. What about the many programs that rely on /etc/init.d/
>>> status/start/stop/restart
>>> I have many services that are monitored by nagios or cron jobs (like
>>> logrotate) that rely on /etc/init.d/ status/start/stop/restart.
>>> I don't want to change them because right now they work on every server
>>> and
>>> I don't want to have to maintain 2 versions of the code or hunt them all
>>> down.
>>
>> There is systemd-sysv-generator which creates wrapper .service for
>> sysv scripts automatically at boot. But you need to specify additional
>> headers if you want to use ordering. See man systemd-sysv-generator.
>
> That is what I am looking for (systemd-sysv-generator), but does that mean
> systemd will not use the .service files and the system will go back to
> running all start-up scripts in order via init.d style S01-S99?
> I don't really care that much as boot time does not matter (I rarely reboo

Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Chad

On 6/23/2015 1:41 PM, Ronny Chevalier wrote:

On Tue, Jun 23, 2015 at 10:16 PM, Chad  wrote:

On 6/23/2015 1:01 PM, Reindl Harald wrote:



Am 23.06.2015 um 21:45 schrieb Chad:

The new systemd way would be to type (23 total characters, no tab
complete):
systemctl restart httpd
Maybe I could tab complete systemctl, but I don't currently have a
CentOS 7 system to test on.


maybe you should just install CentOS inside a VM and test it

[root@srv-rhsoft:~]$ systemctl restart h
halt-local.service   haveged.service home.mount
hostapd-guest.service
httpd-lounge-worker.service  hybrid-sleep.target
halt.target  hibernate.target
hostapd-guest-interface.service  hostapd.service httpd.service



The real issue is that I have to know (in the above example) that it is
httpd not http.
With so many systems, distros, and services it is hard to remember every
service name exactly (and some names are very long). For example ntpd
has a d, but nfs does not.
Tab completion fixes this issue for me.

How can I use tab completion with systemd?


as like for any other software - hit the TAB key


#
2. How to find all possible services:

The init way:
ls -l /etc/init/d

The systemd way:
ls -l /lib/systemd/system/*.service /etc/systemd/system/*.service

This seems WAY harder and I have to remember 2 locations instead of 1


nobody but you installs systemd-units in /etc/ and so you have only one
location AND customized ones - with sysvinit you
had no way to override /etc/init.d/httpd without doing the work after each
update again


Harald,
Thank you for your reply and time.

I will make some time at some point to install CentOS 7 again, I just don't
have one installed right now.

#1 I did not know you could tab complete that way! i.e. as part of a command
argument, not just as part of a path.
Guess I learned something new after 20 years :)

#2 I can see the advantages of having a local override just like /usr/bin
has /usr/local/bin.
Out of curiosity is there a reason the team did not follow the local pattern
with something like: /lib/systemd/local/system?
It is easy enough to create an alias on systems I use often, it will just
take time to learn/memorize the new paths, I am so used to /etc/init.d.


See http://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
for why /lib/ is not used anymore.

Anyway, /usr is considered to be vendor specific (what your distro
provides you) and you should not modify it. /etc, in the other hand,
is entirely for you. If you want to override a unit configuration, you
do not modify /usr/lib/systemd/system/foobar.service but you put your
version in /etc/systemd/system/foobar.service. Then you reload the
units via systemctl daemon-reload. systemctl also provides a simple
tool to do this:

systemctl edit --full foobar.service

It will copy the unit in /etc and open your editor. When you save and
quit, it will automatically run systemctl daemon-reload. You can also
only modify just one directive of a unit file by using:

systemctl edit foobar.service

It will create /etc/systemd/system/foobar.service.d/override.conf and
open your editor. In this file you just have to put the
lines/directives that you want to modify from the original one,
without having to edit the entire unit.


^C

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel
I guess I am used to /usr/local/bin, /usr/local/src, /lib/local, etc. So I wondered why /usr/lib/systemd for system 
files and /etc/systemd for local files as opposed to something like /usr/lib/local/systemd or maybe 
/usr/local/lib/systemd. I don't have strong feelings about it and I did not know any of the history until I read your 
reply and the link you sent. I know that as a group developers normally have a reason for what they do so  I was curios 
why the move away from the local dir standard. I use /etc/ all the time as you know tons of stuff follows that 
path, so that one is no big deal.


^C


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


Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Chad

Mr. Chevalier,
Thank you for your time and reply.

On 6/23/2015 1:30 PM, Ronny Chevalier wrote:

On Tue, Jun 23, 2015 at 9:45 PM, Chad  wrote:

I am sure this is the wrong place to send this e-mail, but I could not find
another place to send it.

Hi,

It is the good place :)

Great, thanks.

I want to learn and use systemd, but have run into a few problems on my way.
Please don't see this as an attack on systemd, I want to learn something
new, but change is hard.

I am an old school kind of sysadmin and I am planning on moving from CentOS
6 to CentOS 7, but I am having trouble with systemd. I am hoping you know
some shortcuts/tricks to help me learn the new way.

#
1. I can't spell. With init I don't have to know how to spell things because
I have tab complete. I use tab complete for almost every command I type. For
example:
/e gets -> /etc/
/etc/in  gets -> /etc/init
/etc/init.  gets -> /etc/init.d/
/etc/init.d/ht /etc/init.d/httpd
/etc/init.d/httpd restart
So I entered 19 characters and got 25 with tab complete.

The new systemd way would be to type (23 total characters, no tab complete):
systemctl restart httpd
Maybe I could tab complete systemctl, but I don't currently have a CentOS 7
system to test on.

The real issue is that I have to know (in the above example) that it is
httpd not http.
With so many systems, distros, and services it is hard to remember every
service name exactly (and some names are very long). For example ntpd has a
d, but nfs does not.
Tab completion fixes this issue for me.

How can I use tab completion with systemd?

If you use either bash or zsh, systemd provides shell completion for them.

You could do something like:

systemctl start htt
systemctl st

or else, and it will complete it.
I use bash. This is a cool trick that systemd has over init.d. I know not all programs can do that shell completion, for 
example /etc/init.d/httpd res does not work (I try it all the time out of tab completion habit!).




#
2. How to find all possible services:

The init way:
ls -l /etc/init/d

The systemd way:
ls -l /lib/systemd/system/*.service /etc/systemd/system/*.service

This seems WAY harder and I have to remember 2 locations instead of 1.

There is:

systemctl list-unit-files

It lists all the units installed on your system. In systemd a unit is
a configuration file that can describe a service, a mount point, a
device,... So a service is a subtype of unit, see "man 5 systemd.unit"
for more information.

So if you want to only display the services, you just have to specify the type

systemctl list-unit-files --type=service

Ok, so that is a lot more to remember than ls -l /etc/init.d, but I can learn 
it.



#
3. List all services and their start levels:


In systemd world, start levels equivalent are the targets (see man 5
systemd.target). A target is a synchronisation point between multiple
units. For example, there is sysinit.target which is the
synchronization point for early boot services. This way a unit can ask
to be started only after a specific target, for example.


The init way (all services):
chkconfig --list

The init way (only active services. I use this a lot):
chkconfig --list | grep :on

The systemd way (all services):
systemctl list-unit-files --type=service

The systemd way (only active services, I don't know how to do this).
systemctl ???


With systemctl you can provide a filter according to the current state
of a unit. If you want to list all the active service, you can do:

systemctl --state=active --type=service list-units

Ok, again more to type and remember, but memorization is not out of the 
question.



#
4. What about the many programs that rely on /etc/init.d/
status/start/stop/restart
I have many services that are monitored by nagios or cron jobs (like
logrotate) that rely on /etc/init.d/ status/start/stop/restart.
I don't want to change them because right now they work on every server and
I don't want to have to maintain 2 versions of the code or hunt them all
down.

There is systemd-sysv-generator which creates wrapper .service for
sysv scripts automatically at boot. But you need to specify additional
headers if you want to use ordering. See man systemd-sysv-generator.
That is what I am looking for (systemd-sysv-generator), but does that mean systemd will not use the .service files and 
the system will go back to running all start-up scripts in order via init.d style S01-S99?
I don't really care that much as boot time does not matter (I rarely reboot and always have a secondary server that can 
take the load. I run all clusters or active/backup.)

Is there some trick/3rd party script to create /etc/init.d wrappers/scripts
to make all the services work with the old path?
Something like:
ln -s /lib/systemd/system/.service /etc/init.d/
Or maybe a shell script like:
service=`basename "$0"`
systemctl $1 $service

So I would like to move forward with systemd (and will eventually have to if
I want modern/supported OSs), but systemd seems harde

Re: [systemd-devel] How to provision a container after creation via a script

2015-06-23 Thread Chris Morgan
On Tue, Jun 23, 2015 at 4:18 PM, Matthew Karas  wrote:
> I have a few gigs - so it shouldn't be a problem.  I'm using parallels
> 9.  I will try manually when I have the time.
>
> On Tue, Jun 23, 2015 at 2:18 PM, Johannes Ernst
>  wrote:
>>
>>> On Jun 23, 2015, at 7:45, Matthew Karas  wrote:
>>>
>>> I am trying to configure a container after creation using machinectl
>>> but I'm coming up against problems in my implementation.  If this
>>> isn't the correct way to set up a container after creation please let
>>> me know the right way.
>>>
>>> -My Implementation--
>>> I'm running a bash loop installing modules via systemd-nspawn on the machine
>>>
>>> systemd-nspawn -m  dnf -y install 
>>>
>>> The machine was created via this command
>>>
>>> sudo machinectl pull-raw --verify=no  
>>>
>>> -My Problem---
>>>
>>> The script installs a few packages then hangs saying the command for
>>> systemd-nspawn was killed.  Each attempt installs a few more packages.
>>>
>>> Once the script hangs - I have to reboot the system, as systemd-nspawn
>>> says the file system is busy.  There is no way to cancel the script
>>> unless you close the terminal.
>>>
>>> -My System
>>>
>>> I'm on a macbook pro running parallels 9 - the VM is a fedora 22 install.
>>
>> I’m doing something rather similar on a macbook pro running VirtualBox and 
>> Arch. Have not run into problems.
>>
>> Does your scenario work if you do the installation manually from the shell 
>> instead of from a script?
>>
>> Just to state the obvious: the virtual machine has enough memory?
>>
>>
>>> ___
>>> systemd-devel mailing list
>>> systemd-devel@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


If the script doesn't contain proprietary information could you share
it? Wouldn't mind trying it here under my F22 install.

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


Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Ronny Chevalier
On Tue, Jun 23, 2015 at 10:16 PM, Chad  wrote:
> On 6/23/2015 1:01 PM, Reindl Harald wrote:
>>
>>
>>
>> Am 23.06.2015 um 21:45 schrieb Chad:
>>>
>>> The new systemd way would be to type (23 total characters, no tab
>>> complete):
>>> systemctl restart httpd
>>> Maybe I could tab complete systemctl, but I don't currently have a
>>> CentOS 7 system to test on.
>>
>>
>> maybe you should just install CentOS inside a VM and test it
>>
>> [root@srv-rhsoft:~]$ systemctl restart h
>> halt-local.service   haveged.service home.mount
>> hostapd-guest.service
>> httpd-lounge-worker.service  hybrid-sleep.target
>> halt.target  hibernate.target
>> hostapd-guest-interface.service  hostapd.service httpd.service
>>
>>
>>> The real issue is that I have to know (in the above example) that it is
>>> httpd not http.
>>> With so many systems, distros, and services it is hard to remember every
>>> service name exactly (and some names are very long). For example ntpd
>>> has a d, but nfs does not.
>>> Tab completion fixes this issue for me.
>>>
>>> How can I use tab completion with systemd?
>>
>>
>> as like for any other software - hit the TAB key
>>
>>> #
>>> 2. How to find all possible services:
>>>
>>> The init way:
>>> ls -l /etc/init/d
>>>
>>> The systemd way:
>>> ls -l /lib/systemd/system/*.service /etc/systemd/system/*.service
>>>
>>> This seems WAY harder and I have to remember 2 locations instead of 1
>>
>>
>> nobody but you installs systemd-units in /etc/ and so you have only one
>> location AND customized ones - with sysvinit you
>> had no way to override /etc/init.d/httpd without doing the work after each
>> update again
>>
>
> Harald,
> Thank you for your reply and time.
>
> I will make some time at some point to install CentOS 7 again, I just don't
> have one installed right now.
>
> #1 I did not know you could tab complete that way! i.e. as part of a command
> argument, not just as part of a path.
> Guess I learned something new after 20 years :)
>
> #2 I can see the advantages of having a local override just like /usr/bin
> has /usr/local/bin.
> Out of curiosity is there a reason the team did not follow the local pattern
> with something like: /lib/systemd/local/system?
> It is easy enough to create an alias on systems I use often, it will just
> take time to learn/memorize the new paths, I am so used to /etc/init.d.
>

See http://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
for why /lib/ is not used anymore.

Anyway, /usr is considered to be vendor specific (what your distro
provides you) and you should not modify it. /etc, in the other hand,
is entirely for you. If you want to override a unit configuration, you
do not modify /usr/lib/systemd/system/foobar.service but you put your
version in /etc/systemd/system/foobar.service. Then you reload the
units via systemctl daemon-reload. systemctl also provides a simple
tool to do this:

systemctl edit --full foobar.service

It will copy the unit in /etc and open your editor. When you save and
quit, it will automatically run systemctl daemon-reload. You can also
only modify just one directive of a unit file by using:

systemctl edit foobar.service

It will create /etc/systemd/system/foobar.service.d/override.conf and
open your editor. In this file you just have to put the
lines/directives that you want to modify from the original one,
without having to edit the entire unit.

> ^C
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] ip_forward

2015-06-23 Thread Johannes Ernst
(Morale: in doubt, lean hard on your booleans)

1. Reboot host. (Arch running in VirtualBox on Mac)

2. host> sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1

3. host> sudo systemd-nspawn -M container -b -j -n --bind /home:/home
(Arch subset / UBOS)

4. container> ping 8.8.8.8
7 packets transmitted, 0 received, 100% packet loss, time 6009ms

5. host> sudo sysctl net.ipv4.ip_forward=0
net.ipv4.ip_forward = 0

6. host> sudo sysctl net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1

7. container> # ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=17.2 ms

This seems reproducible.



Settings:

host> cat /etc/systemd/network/50-containers.network 
[Match]
Name=ve-*

[Network]
Address=0.0.0.0/28
IPMasquerade=yes
IPv4LL=yes
DHCPServer=yes
IPForward=yes
DNS=192.168.138.1


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


Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Ronny Chevalier
On Tue, Jun 23, 2015 at 9:45 PM, Chad  wrote:
> I am sure this is the wrong place to send this e-mail, but I could not find
> another place to send it.

Hi,

It is the good place :)

> I want to learn and use systemd, but have run into a few problems on my way.
> Please don't see this as an attack on systemd, I want to learn something
> new, but change is hard.
>
> I am an old school kind of sysadmin and I am planning on moving from CentOS
> 6 to CentOS 7, but I am having trouble with systemd. I am hoping you know
> some shortcuts/tricks to help me learn the new way.
>
> #
> 1. I can't spell. With init I don't have to know how to spell things because
> I have tab complete. I use tab complete for almost every command I type. For
> example:
> /e gets -> /etc/
> /etc/in  gets -> /etc/init
> /etc/init.  gets -> /etc/init.d/
> /etc/init.d/ht /etc/init.d/httpd
> /etc/init.d/httpd restart
> So I entered 19 characters and got 25 with tab complete.
>
> The new systemd way would be to type (23 total characters, no tab complete):
> systemctl restart httpd
> Maybe I could tab complete systemctl, but I don't currently have a CentOS 7
> system to test on.
>
> The real issue is that I have to know (in the above example) that it is
> httpd not http.
> With so many systems, distros, and services it is hard to remember every
> service name exactly (and some names are very long). For example ntpd has a
> d, but nfs does not.
> Tab completion fixes this issue for me.
>
> How can I use tab completion with systemd?

If you use either bash or zsh, systemd provides shell completion for them.

You could do something like:

systemctl start htt
systemctl st

or else, and it will complete it.

>
>
> #
> 2. How to find all possible services:
>
> The init way:
> ls -l /etc/init/d
>
> The systemd way:
> ls -l /lib/systemd/system/*.service /etc/systemd/system/*.service
>
> This seems WAY harder and I have to remember 2 locations instead of 1.

There is:

systemctl list-unit-files

It lists all the units installed on your system. In systemd a unit is
a configuration file that can describe a service, a mount point, a
device,... So a service is a subtype of unit, see "man 5 systemd.unit"
for more information.

So if you want to only display the services, you just have to specify the type

systemctl list-unit-files --type=service

>
> #
> 3. List all services and their start levels:
>

In systemd world, start levels equivalent are the targets (see man 5
systemd.target). A target is a synchronisation point between multiple
units. For example, there is sysinit.target which is the
synchronization point for early boot services. This way a unit can ask
to be started only after a specific target, for example.

> The init way (all services):
> chkconfig --list
>
> The init way (only active services. I use this a lot):
> chkconfig --list | grep :on
>
> The systemd way (all services):
> systemctl list-unit-files --type=service
>
> The systemd way (only active services, I don't know how to do this).
> systemctl ???
>

With systemctl you can provide a filter according to the current state
of a unit. If you want to list all the active service, you can do:

systemctl --state=active --type=service list-units

>
> #
> 4. What about the many programs that rely on /etc/init.d/
> status/start/stop/restart
> I have many services that are monitored by nagios or cron jobs (like
> logrotate) that rely on /etc/init.d/ status/start/stop/restart.
> I don't want to change them because right now they work on every server and
> I don't want to have to maintain 2 versions of the code or hunt them all
> down.

There is systemd-sysv-generator which creates wrapper .service for
sysv scripts automatically at boot. But you need to specify additional
headers if you want to use ordering. See man systemd-sysv-generator.

> Is there some trick/3rd party script to create /etc/init.d wrappers/scripts
> to make all the services work with the old path?
> Something like:
> ln -s /lib/systemd/system/.service /etc/init.d/
> Or maybe a shell script like:
> service=`basename "$0"`
> systemctl $1 $service
>
> So I would like to move forward with systemd (and will eventually have to if
> I want modern/supported OSs), but systemd seems harder to deal with and will
> break a lot of my existing scripts/cronjobs/monitors.
>
>
> Thank you all for your work on FOSS, you are making the world a better
> place!!
>
> --
>
> ^C
> Chad Columbus
> 20 years of application development and sysadmin
> Currently maintaining about 30 CentOS 6 servers.
> Have maintained over 1,000 linux servers over the years.
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to provision a container after creation via a script

2015-06-23 Thread Matthew Karas
I have a few gigs - so it shouldn't be a problem.  I'm using parallels
9.  I will try manually when I have the time.

On Tue, Jun 23, 2015 at 2:18 PM, Johannes Ernst
 wrote:
>
>> On Jun 23, 2015, at 7:45, Matthew Karas  wrote:
>>
>> I am trying to configure a container after creation using machinectl
>> but I'm coming up against problems in my implementation.  If this
>> isn't the correct way to set up a container after creation please let
>> me know the right way.
>>
>> -My Implementation--
>> I'm running a bash loop installing modules via systemd-nspawn on the machine
>>
>> systemd-nspawn -m  dnf -y install 
>>
>> The machine was created via this command
>>
>> sudo machinectl pull-raw --verify=no  
>>
>> -My Problem---
>>
>> The script installs a few packages then hangs saying the command for
>> systemd-nspawn was killed.  Each attempt installs a few more packages.
>>
>> Once the script hangs - I have to reboot the system, as systemd-nspawn
>> says the file system is busy.  There is no way to cancel the script
>> unless you close the terminal.
>>
>> -My System
>>
>> I'm on a macbook pro running parallels 9 - the VM is a fedora 22 install.
>
> I’m doing something rather similar on a macbook pro running VirtualBox and 
> Arch. Have not run into problems.
>
> Does your scenario work if you do the installation manually from the shell 
> instead of from a script?
>
> Just to state the obvious: the virtual machine has enough memory?
>
>
>> ___
>> systemd-devel mailing list
>> systemd-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Chad

On 6/23/2015 1:01 PM, Reindl Harald wrote:



Am 23.06.2015 um 21:45 schrieb Chad:

The new systemd way would be to type (23 total characters, no tab
complete):
systemctl restart httpd
Maybe I could tab complete systemctl, but I don't currently have a
CentOS 7 system to test on.


maybe you should just install CentOS inside a VM and test it

[root@srv-rhsoft:~]$ systemctl restart h
halt-local.service   haveged.service home.mount 
  hostapd-guest.service
httpd-lounge-worker.service  hybrid-sleep.target
halt.target  hibernate.target 
hostapd-guest-interface.service  hostapd.service httpd.service



The real issue is that I have to know (in the above example) that it is
httpd not http.
With so many systems, distros, and services it is hard to remember every
service name exactly (and some names are very long). For example ntpd
has a d, but nfs does not.
Tab completion fixes this issue for me.

How can I use tab completion with systemd?


as like for any other software - hit the TAB key


#
2. How to find all possible services:

The init way:
ls -l /etc/init/d

The systemd way:
ls -l /lib/systemd/system/*.service /etc/systemd/system/*.service

This seems WAY harder and I have to remember 2 locations instead of 1


nobody but you installs systemd-units in /etc/ and so you have only one 
location AND customized ones - with sysvinit you
had no way to override /etc/init.d/httpd without doing the work after each 
update again



Harald,
Thank you for your reply and time.

I will make some time at some point to install CentOS 7 again, I just don't 
have one installed right now.

#1 I did not know you could tab complete that way! i.e. as part of a command 
argument, not just as part of a path.
Guess I learned something new after 20 years :)

#2 I can see the advantages of having a local override just like /usr/bin has 
/usr/local/bin.
Out of curiosity is there a reason the team did not follow the local pattern 
with something like: /lib/systemd/local/system?
It is easy enough to create an alias on systems I use often, it will just take time to learn/memorize the new paths, I 
am so used to /etc/init.d.


^C
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] How to get used to systemd vs init

2015-06-23 Thread Chad

I am sure this is the wrong place to send this e-mail, but I could not find 
another place to send it.
I want to learn and use systemd, but have run into a few problems on my way.
Please don't see this as an attack on systemd, I want to learn something new, 
but change is hard.

I am an old school kind of sysadmin and I am planning on moving from CentOS 6 to CentOS 7, but I am having trouble with 
systemd. I am hoping you know some shortcuts/tricks to help me learn the new way.


#
1. I can't spell. With init I don't have to know how to spell things because I have tab complete. I use tab complete for 
almost every command I type. For example:

/e gets -> /etc/
/etc/in  gets -> /etc/init
/etc/init.  gets -> /etc/init.d/
/etc/init.d/ht /etc/init.d/httpd
/etc/init.d/httpd restart
So I entered 19 characters and got 25 with tab complete.

The new systemd way would be to type (23 total characters, no tab complete):
systemctl restart httpd
Maybe I could tab complete systemctl, but I don't currently have a CentOS 7 
system to test on.

The real issue is that I have to know (in the above example) that it is httpd 
not http.
With so many systems, distros, and services it is hard to remember every service name exactly (and some names are very 
long). For example ntpd has a d, but nfs does not.

Tab completion fixes this issue for me.

How can I use tab completion with systemd?


#
2. How to find all possible services:

The init way:
ls -l /etc/init/d

The systemd way:
ls -l /lib/systemd/system/*.service /etc/systemd/system/*.service

This seems WAY harder and I have to remember 2 locations instead of 1.

#
3. List all services and their start levels:

The init way (all services):
chkconfig --list

The init way (only active services. I use this a lot):
chkconfig --list | grep :on

The systemd way (all services):
systemctl list-unit-files --type=service

The systemd way (only active services, I don't know how to do this).
systemctl ???


#
4. What about the many programs that rely on /etc/init.d/ 
status/start/stop/restart
I have many services that are monitored by nagios or cron jobs (like logrotate) that rely on /etc/init.d/ 
status/start/stop/restart.
I don't want to change them because right now they work on every server and I don't want to have to maintain 2 versions 
of the code or hunt them all down.

Is there some trick/3rd party script to create /etc/init.d wrappers/scripts to 
make all the services work with the old path?
Something like:
ln -s /lib/systemd/system/.service /etc/init.d/
Or maybe a shell script like:
service=`basename "$0"`
systemctl $1 $service

So I would like to move forward with systemd (and will eventually have to if I want modern/supported OSs), but systemd 
seems harder to deal with and will break a lot of my existing scripts/cronjobs/monitors.



Thank you all for your work on FOSS, you are making the world a better place!!

--

^C
Chad Columbus
20 years of application development and sysadmin
Currently maintaining about 30 CentOS 6 servers.
Have maintained over 1,000 linux servers over the years.

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


Re: [systemd-devel] journalctl - "Error was encountered while opening journal files: Invalid argument"

2015-06-23 Thread Johannes Ernst
I realized later that this virtual machine had ended up with a borked btrfs 
filesystem. I blame it on a problem with the outer OSX filesystem, but 
regardless, it does not seem to be a systemd problem.

So disregard this error.

Cheers,



Johannes.

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


Re: [systemd-devel] How to provision a container after creation via a script

2015-06-23 Thread Johannes Ernst

> On Jun 23, 2015, at 7:45, Matthew Karas  wrote:
> 
> I am trying to configure a container after creation using machinectl
> but I'm coming up against problems in my implementation.  If this
> isn't the correct way to set up a container after creation please let
> me know the right way.
> 
> -My Implementation--
> I'm running a bash loop installing modules via systemd-nspawn on the machine
> 
> systemd-nspawn -m  dnf -y install 
> 
> The machine was created via this command
> 
> sudo machinectl pull-raw --verify=no  
> 
> -My Problem---
> 
> The script installs a few packages then hangs saying the command for
> systemd-nspawn was killed.  Each attempt installs a few more packages.
> 
> Once the script hangs - I have to reboot the system, as systemd-nspawn
> says the file system is busy.  There is no way to cancel the script
> unless you close the terminal.
> 
> -My System
> 
> I'm on a macbook pro running parallels 9 - the VM is a fedora 22 install.

I’m doing something rather similar on a macbook pro running VirtualBox and 
Arch. Have not run into problems.

Does your scenario work if you do the installation manually from the shell 
instead of from a script?

Just to state the obvious: the virtual machine has enough memory?


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

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


[systemd-devel] How to provision a container after creation via a script

2015-06-23 Thread Matthew Karas
I am trying to configure a container after creation using machinectl
but I'm coming up against problems in my implementation.  If this
isn't the correct way to set up a container after creation please let
me know the right way.

-My Implementation--
I'm running a bash loop installing modules via systemd-nspawn on the machine

systemd-nspawn -m  dnf -y install 

The machine was created via this command

sudo machinectl pull-raw --verify=no  

-My Problem---

The script installs a few packages then hangs saying the command for
systemd-nspawn was killed.  Each attempt installs a few more packages.

Once the script hangs - I have to reboot the system, as systemd-nspawn
says the file system is busy.  There is no way to cancel the script
unless you close the terminal.

-My System

I'm on a macbook pro running parallels 9 - the VM is a fedora 22 install.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] no tar balls at release time

2015-06-23 Thread Dave Reisner
On Tue, Jun 23, 2015 at 01:19:54PM +0200, Kay Sievers wrote:
> On Tue, Jun 23, 2015 at 4:02 AM, Dave Reisner  wrote:
> > On Tue, Jun 23, 2015 at 01:21:36AM +0200, Kay Sievers wrote:
> >> We currently considering to stop creating release tar balls.
> >
> > What's the motivation for this change?
> 
> We focus on git, and git only. We do not want to sign tar balls to
> distribute, but rely on signed git tags only.
> 
> Pre-building stuff to put into tar balls creates too many
> restrictions. It is just plain wrong to pre-build and ship things like
> man pages, which depend on common configure options.
> 
> > I suspect that with this, 'make
> > distcheck' will never again be run and it will eventually break
> > build configurations which don't align with what the CI tests.
> 
> We synced the "make dist" and "git archive" tar balls as much as
> possible now. Even the autotools created one will not contain any
> pre-built stuff anymore besides the autofoo itself.
> 
> We might continue to run distcheck in the CI, but we don't know
> anything for sure at that point in time, only that tar balls are not
> part of the release anymore.

To reiterate -- Arch doesn't care about tarballs going away. I'm
concerned that 'distcheck' provided some amount of pre-release sanity
checking, and I'd prefer that we don't lose that for a project which
already lacks a large amount of in-tree test coverage.

Everyone involved would benefit from something such as the following:
implement the equivalent of the kernels 'make allconfig' and use this
for the CI builds, rather than a bare "./configure" (which won't pull in
much based on the deps being installed). I realize this can't be 100% of
the options since there's conflicting and "legacy" switches (like
split-usr). However, you'll at least be giving build system more
thorough testing, and decreasing the likelihood that release day is when
broken builds are reported on the mailing list.

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


Re: [systemd-devel] remote-fs dependency/ordering on network

2015-06-23 Thread Lukáš Nykrýn
Jan Synacek píše v Út 23. 06. 2015 v 15:39 +0200:
> Lennart Poettering  writes:
> 
> > On Mon, 22.06.15 14:49, Jan Synacek (jsyna...@redhat.com) wrote:
> >
> >> Lukáš Nykrýn  writes:
> >> 
> >> > Jan Synáček píše v Čt 18. 06. 2015 v 15:41 +0200:
> >> >> Is remote-fs.target somehow dependent/ordered on network.target or
> >> >> network-online.target? I can't find anything that would suggest it
> >> >> actually is.
> >> >> 
> >> >> Cheers,
> >> >
> >> > If I am not mistaken remote-fs.target should be after all netdev mounts
> >> > and netdev mounts should be after network-online.target.
> >> 
> >> I'm sure it should, but I don't see any evidence that it really is. My
> >> mnt-nfs.mount that was generated by the fstab generator is ordered
> >> before remote-fs.target, which is correct. However, I can't find any
> >> dependency between remote-fs.target, and network*. I'm quite puzzled how
> >> NFS mounts mounted on boot can actually work correctly right now.
> >
> > There's also remote-fs-pre.target. That's ordered before all NFS
> > mounts, and that's what the online stuff should be ordered before.
> 
> All seems to be in order when the system is booting up. However, during
> shutdown, the order in which network* and remote* are taken down seems
> to be incorrect. If you could take a look at [1], that would help a bit,
> since I'm really clueless right now.
> 
> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1214466
> 
> Cheers,

There is something messed up on that system.

Jun 23 07:30:56 acer.greshko.com systemd[1523]: Fixing conflicting jobs
-.slice/start,-.slice/stop by deleting job -.slice/stop
Jun 23 07:30:56 acer.greshko.com systemd[1523]: Fixing conflicting jobs
shutdown.target/stop,shutdown.target/start by deleting job
shutdown.target/stop
Jun 23 07:30:56 acer.greshko.com systemd[1523]: Deleting job
-.slice/start as dependency of job shutdown.target/stop
Jun 23 07:30:56 acer.greshko.com systemd[1546]: Fixing conflicting jobs
shutdown.target/stop,shutdown.target/start by deleting job
shutdown.target/stop

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


Re: [systemd-devel] remote-fs dependency/ordering on network

2015-06-23 Thread Jan Synacek
Lennart Poettering  writes:

> On Mon, 22.06.15 14:49, Jan Synacek (jsyna...@redhat.com) wrote:
>
>> Lukáš Nykrýn  writes:
>> 
>> > Jan Synáček píše v Čt 18. 06. 2015 v 15:41 +0200:
>> >> Is remote-fs.target somehow dependent/ordered on network.target or
>> >> network-online.target? I can't find anything that would suggest it
>> >> actually is.
>> >> 
>> >> Cheers,
>> >
>> > If I am not mistaken remote-fs.target should be after all netdev mounts
>> > and netdev mounts should be after network-online.target.
>> 
>> I'm sure it should, but I don't see any evidence that it really is. My
>> mnt-nfs.mount that was generated by the fstab generator is ordered
>> before remote-fs.target, which is correct. However, I can't find any
>> dependency between remote-fs.target, and network*. I'm quite puzzled how
>> NFS mounts mounted on boot can actually work correctly right now.
>
> There's also remote-fs-pre.target. That's ordered before all NFS
> mounts, and that's what the online stuff should be ordered before.

All seems to be in order when the system is booting up. However, during
shutdown, the order in which network* and remote* are taken down seems
to be incorrect. If you could take a look at [1], that would help a bit,
since I'm really clueless right now.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1214466

Cheers,
-- 
Jan Synacek
Software Engineer, Red Hat


signature.asc
Description: PGP signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [ANNOUNCE] systemd v221

2015-06-23 Thread Michael Biebl
2015-06-19 16:11 GMT+02:00 Michael Biebl :
> I'm very disappointed (once again) how this release was handled.
> Lot's of last minute changes. Especially
> https://github.com/systemd/systemd/pull/293
> really sucks.

While I'm still disappointed how this issue was handled and I still
find the arguments for this pull request rather unconvincing, my
reaction was not ok either. I apologize for that.


Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Reload manager defaults at daemon-reload

2015-06-23 Thread Kay Sievers
On Tue, Jun 23, 2015 at 2:47 PM, Thomas Blume  wrote:
>
> "systemctl daemon-reload" should also update the manager defaults from
> /etc/systemd/system.conf.
> For details, see:
> http://lists.freedesktop.org/archives/systemd-devel/2015-June/033062.html

Any specific reason not to use github?

Patches can still be handled on the mailing list, but it's much easier
for everybody to use github and track things there and get automatic
build testing before a possible merge.

Thanks,
Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] FR: different gcrypt options for joornald and importd

2015-06-23 Thread Kay Sievers
On Mon, Jun 8, 2015 at 7:58 PM, Lennart Poettering
 wrote:
> On Mon, 08.06.15 19:24, Alexey Shabalin (a.shaba...@gmail.com) wrote:

>> > You can build systemd twice to do this. On Fedora we build it twice
>> > for example to get python2 as well as python3 modules.
>> >
>> > But: what's the reason for this? THis sounds like a weird choice?
>> >
>> We are still support separate /usr, but libgcrypt in /usr/lib now (i am
>> open request to mantainer for move libgcrypt to /lib)
>> libgcrypt in /usr/lib critical for journal and not important for importd.
>
> I am not sure this is really something to support upstream. I mean,
> LUKS support generally needs libgcrypt too, and hence it's really
> wrong to assume gcrypt can be located in /usr if you use split
> usr... I am not sure we want to support systems with split usr and
> gcrypt in /usr.

This topic came up in a different thread too:
  https://github.com/systemd/systemd/pull/331

I'm convinced we should limit configure options to avoid external
dependencies, but not add options for individual tools. The matrix of
options we want to support upstream should be minimal and not cover
rather exotic requirement or setups.

Also this should still be valid as much as possible and indicate the
systemd-wide flags:
$ /usr/lib/systemd/systemd --version
systemd 221
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP
+LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS
+KMOD +IDN

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


[systemd-devel] Reload manager defaults at daemon-reload

2015-06-23 Thread Thomas Blume


"systemctl daemon-reload" should also update the manager defaults from
/etc/systemd/system.conf.
For details, see:
http://lists.freedesktop.org/archives/systemd-devel/2015-June/033062.html


Regards

Thomas Blume

--
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham 
Norton, HRB 21284 (AG Nürnberg)
Maxfeldstr. 5 / D-90409 Nürnberg / Phone: +49-911-740 53 - 0 / VOIP: 3919
GPG 2048R/2CD4D3E8 9A50 048F 1C73 59AA 4D2E  424E B3C6 3FD9 2CD4 D3E8From f4caa8b44c1596b44723d0ffdff098916b2e0264 Mon Sep 17 00:00:00 2001
From: Thomas Blume 
Date: Tue, 23 Jun 2015 14:39:04 +0200
Subject: [PATCH] Reload manager defaults at daemon-reload

"systemctl daemon-reload" should also update the manager defaults from
/etc/systemd/system.conf.
For details, see:
http://lists.freedesktop.org/archives/systemd-devel/2015-June/033062.html
---
 src/core/main.c | 28 
 1 file changed, 28 insertions(+)

diff --git a/src/core/main.c b/src/core/main.c
index 332453a..16c19b1 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -685,6 +685,29 @@ static int parse_config_file(void) {
 return 0;
 }
 
+static int reload_manager_defaults(Manager *m) {
+int r;
+
+assert(m);
+
+r = parse_config_file();
+if (r < 0)
+   return r;
+
+m->default_std_output = arg_default_std_output;
+m->default_std_error = arg_default_std_error;
+m->default_timeout_start_usec = arg_default_timeout_start_usec;
+m->default_timeout_stop_usec = arg_default_timeout_stop_usec;
+m->default_restart_usec = arg_default_restart_usec;
+m->default_start_limit_interval = arg_default_start_limit_interval;
+m->default_start_limit_burst = arg_default_start_limit_burst;
+
+manager_set_default_rlimits(m, arg_default_rlimit);
+manager_environment_add(m, NULL, arg_default_environment);
+
+return 0;
+}
+
 static int parse_argv(int argc, char *argv[]) {
 
 enum {
@@ -1763,6 +1786,11 @@ int main(int argc, char *argv[]) {
 
 case MANAGER_RELOAD:
 log_info("Reloading.");
+
+r = reload_manager_defaults(m);
+if (r < 0)
+log_error("Failed to reload manager defaults: %s", strerror(-r));
+
 r = manager_reload(m);
 if (r < 0)
 log_error_errno(r, "Failed to reload: %m");
-- 
2.1.4

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


[systemd-devel] sd-bus object manager question

2015-06-23 Thread David Härdeman

Hi,

as an experiment I've tried porting a toy dbus daemon over to sd-bus. It 
seems to be working well so far and I have to say I really like the 
sd-bus API over the gdbus one (sd-bus feels like I'm still writing 
C...can't say the same thing about gdbus).


Now, a question...how is an object manager supposed to be implemented in 
sd-bus?


I've seen that there's a sd_bus_add_object_manager() function in 
sd-bus.h, but how would I notify the object manager when objects are 
added and removed?


Two likely candidates seemed to be:
sd_bus_emit_object_added()
sd_bus_emit_object_removed()

But calling them did not seem to do the right thing. And there seems to 
be zero usage of sd_bus_add_object_manager() in the systemd tree itself 
(though plenty of calls to sd_bus_add_node_enumerator() which might be 
related?).


So, could anyone provide me with an example of how to use 
sd_bus_add_object_manager()?


Regards,
David

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


Re: [systemd-devel] no tar balls at release time

2015-06-23 Thread Kay Sievers
On Tue, Jun 23, 2015 at 4:02 AM, Dave Reisner  wrote:
> On Tue, Jun 23, 2015 at 01:21:36AM +0200, Kay Sievers wrote:
>> We currently considering to stop creating release tar balls.
>
> What's the motivation for this change?

We focus on git, and git only. We do not want to sign tar balls to
distribute, but rely on signed git tags only.

Pre-building stuff to put into tar balls creates too many
restrictions. It is just plain wrong to pre-build and ship things like
man pages, which depend on common configure options.

> I suspect that with this, 'make
> distcheck' will never again be run and it will eventually break
> build configurations which don't align with what the CI tests.

We synced the "make dist" and "git archive" tar balls as much as
possible now. Even the autotools created one will not contain any
pre-built stuff anymore besides the autofoo itself.

We might continue to run distcheck in the CI, but we don't know
anything for sure at that point in time, only that tar balls are not
part of the release anymore.

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


Re: [systemd-devel] no tar balls at release time

2015-06-23 Thread Michael Olbrich
On Mon, Jun 22, 2015 at 10:21:18PM -0400, Mike Gilbert wrote:
> On Mon, Jun 22, 2015 at 7:30 PM, Lennart Poettering
>  wrote:
> > On Tue, 23.06.15 01:21, Kay Sievers (k...@vrfy.org) wrote:
> >
> >> We currently considering to stop creating release tar balls.
> >>
> >> For build systems which still require them, they can be created
> >> locally from the upstream git repository with:
> >>   git archive --format=tar --prefix=systemd-$(VERSION)/ $(VERSION) | \
> >> xz > systemd-$(VERSION).tar.xz
> >>
> >> These tar balls will not include the "500k of shell scripts" added by
> >> autotools. These files need to be added to the extracted tarball by
> >> running ./autogen.sh.
> >>
> >> These tar balls will also not include any generated content like
> >> fonts, man, html pages. This is intentional.
> >
> > Which of course means the build tools for all of these need to be
> > around on the build machines, as *everything* will be rebuilt from
> > scratch now. Specifically you need
> > autoconf/automake/python/perl/m4/xsltproc/... on every build machine.
> >
> > Hence the question to ask is: is anyone downstream relying on the
> > pre-built stuff, and has a very good reason why he couldn't just
> > install the build tools on his build machine and build things with
> > that?
> 
> On Gentoo, most users build from source, so this means additional
> dependencies on most users' systems. We would appreciate having the
> autotools-generated tarballs, but we can certainly live without them.
> 
> FYI, having to run autoreconf introduces the following dependencies for us:
> 
> app-text/docbook-xml-dtd:4.2
> app-text/docbook-xml-dtd:4.5
> app-text/docbook-xsl-stylesheets
> dev-libs/libxslt:0
> >=dev-libs/libgcrypt-1.4.5:0"

I don't mind the autotools requirements. But building libgcrypt just for
autogen is really annoying when cross-compiling for systems where libgcrypt
isn't installed at all.

So, if you do this, please add all necessary m4 files to the tarballs or
make it optional, the way gtk-doc was handled.

Regards,
Michael

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] no tar balls at release time

2015-06-23 Thread Dimitri John Ledkov
On 23 June 2015 at 00:21, Kay Sievers  wrote:
>
> We currently considering to stop creating release tar balls.
>
> For build systems which still require them, they can be created
> locally from the upstream git repository with:
>   git archive --format=tar --prefix=systemd-$(VERSION)/ $(VERSION) | \
> xz > systemd-$(VERSION).tar.xz
>

Or simply "download" the github generated tarball from tag, which is
called "releases"

Fine by me. We ended up patching configury for us, hence have to
autoreconf the lot anyway.

-- 
Regards,

Dimitri.
Pura Vida!

https://clearlinux.org
Open Source Technology Center
Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] feedback on sd-bus

2015-06-23 Thread Umut Tezduyar Lindskog
Hi,

We recently have reimplemented a central component of our software
stack with sd-bus and the results are very satisfactory. Though, we
have some feedback to discuss.

The reimplemented component is a glib based application. For this
reason, we have integrated GMain with sd-event (using Tom's sample
code). We are aware of the fact that sd-bus is relatively lower level
than gdbus.

- Auto generation tool coming with gdbus (gio) is priceless. Without
the tool, packing/upacking messages are time consuming.

- Reference counting on the bus messages needs to be handled by the
API user which is not that difficult but error prone. Again, maybe
some kind of auto generation tool can help us out. Which brings up
another question which is why are cleanup macros not public?

- A simple proxy object is needed. Simple proxy is needed to figure
out when proxy is online/offline. The current properties of the proxy
and getting events when the properties are changed. By default
creating gdbus proxy is expensive in a way that it starts the proxy,
loads properties etc (All of this can be turned off with flags
though). Maybe systemd's proxy can do all of it in a on-demand way by
default.

- Lennart's sd-bus introduction blog recommends the usage of gdbus if
the application is a glib application. I couldn't understand the
reason for this. We have all the hooks to integrate sd-event with
glib.

- Previously we opened a ticket about the under performing glib
(https://bugzilla.gnome.org/show_bug.cgi?id=749533). There are two
biggies mentioned in the ticket for the under performance. AFAIK,
sd-bus is also using gvariant, so that is not relevant. The other
issue is extra context switch on gdbus which doesn't seem to be
something easy to get rid of. Where does this leave us? A) Use high
level bus implementation with performance penalty, B) Use low level
bus implementation with the penalty of going lower level. Isn't it
possible to either get gdbus close to sd-bus or sd-bus close to gdbus?

Feedback is appreciated,
Umut
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel