[systemd-devel] Please reopen issue #12506

2019-11-18 Thread Marcos Mello
Although util-linux's fstab.d work has stalled, there is still systemd code 
that needs porting to libmount. See Karel's last comment:

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

[systemd-devel] Wiki suggestion

2016-07-22 Thread Marcos Mello
Hi,

SUSE has this nice white paper about systemd in SLE 12:

systemd in SUSE® Linux Enterprise 12
A kinder, gentler introduction from SUSE

https://www.suse.com/docrep/documents/huz0a6bf9a/systemd_in_suse_linux_enterprise_12_white_paper.pdf

It is a good candidate for "Publications" or "Manuals and Documentation for
Users and Administrators" wiki sections.

While you are at it, two nitpicks: "OpenSUSE" can be replaced by "openSUSE" and
"ArchLinux" by "Arch Linux".

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


Re: [systemd-devel] why does bootctl default to /boot and not to /boot/efi?

2016-06-01 Thread Marcos Mello
Mantas Mikulėnas  gmail.com> writes:

> 
> 
> I'd buy into it if vfat weren't so brittle – several times I had to use
syslinux in /boot because the ESP lost *both* kernels I had in it... "sync;
sync; unmount; mount; check" was part of my kernel update ritual for a
while. Maybe it's the Linux driver, maybe it's my UEFI that's bad at FAT, I
dunno.
> I use /boot as ESP on the work laptop, but not really going to merge them
on the personal one just yet.
> 

I fear package managers that do not fsync things. pacman and rpm for example:

https://bbs.archlinux.org/viewtopic.php?id=208403
http://article.gmane.org/gmane.comp.file-systems.xfs.general/62090

Because of this I proposed for systemd-gpt-auto-generator:

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


Re: [systemd-devel] Transaction contains conflicting jobs 'restart' and 'stop'

2016-03-12 Thread Marcos Mello
Orion Poplawski  cora.nwra.com> writes:

> 
> Andrei Borzenkov  gmail.com> writes:
> > 11.03.2016 00:11, Orion Poplawski пишет:
> > > Uoti Urpala  pp1.inet.fi> writes:
> > >> On Thu, 2016-03-10 at 17:51 +, Orion Poplawski wrote:
> > >>> It appears that this is a trigger for this issue.  Removing the
> > >>> conflicts=iptables.service removes it.  This seems like a bug to me
> > >>> though -
> > >>> why is iptables being brought in if the PartOf= is a one-way dep?
> > >>
> > >> I guess it's because it's because firewalld.service has
> > >> "Conflicts=iptables.service", and thus (re)starting firewalld.service
> > >> stops iptables.service; fail2ban.service has PartOf to both, thus both
> > >> the restart and stop are propagated, and conflict.
> > > 
> > > Can't the stop of iptables be dropped because the service is already
stopped
> > > (or more likely not even present)?
> > 
> > One possible implementation is to have firewall.target and make all
> > other services (firewalld, iptables and fail2ban) PartOf this target.
> > You would then start/stop firewall.target instead of individual services.
> 
> I tried this, but I get the same problem:
> 
> # systemctl restart firewall.target
> Failed to restart firewall.target: Transaction contains conflicting jobs
> 'restart' and 'stop' for iptables.service. Probably contradicting
> requirement dependencies configured.
> 
> Also, this doesn't solve the issue of restarting fail2ban if firewalld is
> restarted via "systemctl restart fail2ban" (which someone will do I'm sure),
> unless there is some other dependency that needs to be setup between the
> various units that I don't understand.  Not very familiar with configuring
> targets.


# /usr/lib/systemd/system/firewall.target
[Unit]
Description=Firewall
StopWhenUnneeded=yes

[Install]
WantedBy=basic.target


# /usr/lib/systemd/system/firewalld.service
[Unit]
Description=firewalld - dynamic firewall daemon
Before=network.target
Before=libvirtd.service
Before=NetworkManager.service
After=dbus.service
After=polkit.service
Conflicts=iptables.service ip6tables.service ebtables.service ipset.service
PartOf=firewall.target

[Service]
EnvironmentFile=-/etc/sysconfig/firewalld
ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS
ExecReload=/bin/kill -HUP $MAINPID
# supress to log debug and error output also to /var/log/messages
StandardOutput=null
StandardError=null
Type=dbus
BusName=org.fedoraproject.FirewallD1

[Install]
WantedBy=firewall.target
Alias=dbus-org.fedoraproject.FirewallD1.service


# /usr/lib/systemd/system/fail2ban.service
[Unit]
Description=Fail2Ban Service
Documentation=man:fail2ban(1)
After=network.target iptables.service firewalld.service firewalld.service
PartOf=firewall.target

[Service]
Type=forking
ExecStart=/usr/bin/fail2ban-client -x start
ExecStop=/usr/bin/fail2ban-client stop
ExecReload=/usr/bin/fail2ban-client reload
PIDFile=/var/run/fail2ban/fail2ban.pid
Restart=always

[Install]
WantedBy=multi-user.target


Then enable firewall.target and make all firewall services be
WantedBy=firewall.target instead of basic.target.

However it is troublesome, because users will not restart firewall.target.
They will restart firewalld.service, or iptables.service, or whatever.

Each firewall package could drop a snippet adding a reverse PartOf=
dependency in firewall.target:

# /usr/lib/systemd/system/firewall.target.d/firewalld.conf
[Unit]
PartOf=firewalld.service

This works, as firewalld.service restart will trigger firewall.target
restart and finally fail2ban.service restart. But do not you think it is too
much?

Cannot the restart job for the conflict units be dropped? IMO this is a
valid use case and would make things a lot easier for packagers.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] mount: use libmount to monitor mountinfo & utab

2015-06-02 Thread Marcos Mello
Karel Zak  redhat.com> writes:

> 
> The current implementation directly monitor /proc/self/mountinfo and
> /run/mount/utab files. It's really not optimal because utab file is
> private libmount stuff without any official guaranteed semantic.
> 
> [...]

Please update libmount requirement in README.

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


Re: [systemd-devel] Zombie process still exists after stopping gdm.service

2015-04-20 Thread Marcos Mello
Daniel Drake  endlessm.com> writes:

> 
> So, moments after sending 2 SIGTERMs, SIGKILL is sent to all gdm
> processes. There does not seem to be any consideration of giving the
> process some time to respond to SIGTERMs, nor the fact that I have
> hacked gdm.service to have SendSIGKILL=no as an experiment.
> 

I noticed that too with SendSIGKILL=no.

http://lists.freedesktop.org/archives/systemd-devel/2015-March/029933.html
http://lists.freedesktop.org/archives/systemd-devel/2015-April/030196.html

Squid is not a good example of how a daemon should behave though.

--
Marcos

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


[systemd-devel] Different behaviour when sending SIGTERM

2015-03-29 Thread Marcos Mello
Squid is known to be borked when running as a daemon (background):

http://bugs.squid-cache.org/show_bug.cgi?id=3826#c12

But still I am experiencing a difference between systemd's "built in" signal
delivery and systemctl kill.

# systemctl -l status squid.service
* squid.service - Squid Web Proxy Server
   Loaded: loaded (/etc/systemd/system/squid.service; disabled)
   Active: active (running) since Sun 2015-03-29 15:21:16 BRT; 20s ago
  Process: 1488 ExecStart=/usr/sbin/squid $SQUID_OPTS (code=exited,
status=0/SUCCESS)
 Main PID: 1491 (squid)
   CGroup: /system.slice/squid.service
   |-1489 /usr/sbin/squid -sX
   |-1491 (squid-1) -sX
   |-1492 (ssl_crtd) -s /var/lib/squid/ssl_db -M 4MB -b 4096
   |-1493 (ssl_crtd) -s /var/lib/squid/ssl_db -M 4MB -b 4096
   |-1494 (ssl_crtd) -s /var/lib/squid/ssl_db -M 4MB -b 4096
   |-1495 (ssl_crtd) -s /var/lib/squid/ssl_db -M 4MB -b 4096
   |-1496 (ssl_crtd) -s /var/lib/squid/ssl_db -M 4MB -b 4096
   `-1497 (logfile-daemon) /var/log/squid/access.log

Mar 29 15:21:16 xxx.localdomain squid[1491]: 0 Objects cancelled.
Mar 29 15:21:16 xxx.localdomain squid[1491]: 0 Duplicate URLs purged.
Mar 29 15:21:16 xxx.localdomain squid[1491]: 0 Swapfile clashes avoided.
Mar 29 15:21:16 xxx.localdomain squid[1491]: Took 0.23 seconds (  0.00
objects/sec).
Mar 29 15:21:16 xxx.localdomain squid[1491]: Beginning Validation Procedure
Mar 29 15:21:16 xxx.localdomain systemd[1]: squid.service: Supervising
process 1491 which is not our child. We'll most likely not notice when it exits.
Mar 29 15:21:16 xxx.localdomain squid[1491]: Completed Validation Procedure
Mar 29 15:21:16 xxx.localdomain squid[1491]: Validated 0 Entries
Mar 29 15:21:16 xxx.localdomain squid[1491]: store_swap_size = 0.00 KB
Mar 29 15:21:16 xxx.localdomain squid[1491]: storeLateRelease: released 0
objects

After 'systemctl stop squid.service':

# strace -f -e trace=process -p 1491
Process 1491 attached
+++ killed by SIGKILL +++

When I run 'systemctl kill --kill-who=main squid.service':

# strace -f -e trace=process -p 1510
Process 1510 attached
--- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=1, si_uid=0} ---
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=1516, si_uid=23,
si_status=SIGTERM, si_utime=0, si_stime=0} ---
wait4(-1, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGTERM}], WNOHANG, NULL) = 1516
wait4(-1, 0x7ffd9ffe6624, WNOHANG, NULL) = 0
exit_group(0)   = ?
+++ exited with 0 +++

The modified service file:

# /etc/systemd/system/squid.service
[Unit]
Description=Squid Web Proxy Server
After=network.target nss-lookup.target

[Service]
Type=forking
PIDFile=/run/squid.pid
EnvironmentFile=/etc/sysconfig/squid
#ExecStartPre=/usr/local/libexec/cache_swap.sh
ExecStart=/usr/sbin/squid $SQUID_OPTS
ExecReload=/usr/bin/kill -HUP $MAINPID
#ExecStop=/usr/sbin/squid -k shutdown
KillMode=process
SendSIGKILL=no

[Install]
WantedBy=multi-user.target

Reload works fine. 'squid -k shutdown' (it just sends SIGTERM to the pid
file process) works fine. Any clues? This is Fedora 21 (systemd-216-21)
running squid-3.4.12-2 from updates-testing.

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


Re: [systemd-devel] [PATCH] fstab-generator: do not check btrfs and xfs

2014-06-29 Thread Marcos Mello
Kai Krakow  gmail.com> writes:
> 
> To check this, I've just pulled the original source from git and built it. 
> This is original upstream behavior, no special Gentoo thing. The fsck.btrfs 
> utility is just a shell script. It seems to originate from xfs-progs:
> 
> https://github.com/josefbacik/btrfs-progs/blob/master/fsck.btrfs
> 
> They seem to have their own thinking of whether this utility should exist or 
> not according to the introductionary comment. 
> 

xfsprogs source:

http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfsprogs.git;a=blob;f=fsck/xfs_fsck.sh

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


Re: [systemd-devel] Allow stop jobs to be killed during shutdown

2014-01-25 Thread Marcos Mello
Koen Kooi  dominion.thruhere.net> writes:
[snip]
> 
> To make matters worse, the cylon eye isn't displayed when you boot with
'quiet' in your kernel command line. 
> 

"quiet systemd.show_status=1" shows the gracious Cylon eye.

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


Re: [systemd-devel] fstrim "cron" job

2013-12-21 Thread Marcos Mello
Bastien Nocera  hadess.net> writes:

> 
> Hey,
> 
> I've seen that Ubuntu recently added transparent support for trimming
> filesystems on SSDs:
> https://blueprints.launchpad.net/ubuntu/+spec/core-1311-ssd-trimming
> and in the patch for util-linux:
> https://launchpadlibrarian.net/159909554/util-linux_2.20.1-5.1ubuntu11.diff.gz
> 
> (looks for fstrim-all)
> 
> I wanted to integrate that in Fedora, through a systemd daily unit. I
> was wondering whether this sort of integration (I'd intend to port the
> fstrim-all code to C) should be in systemd itself, or whether it should
> be a unit shipped separately (in the util-linux package maybe?).
> 
> Cheers
> 

Karel added fstrim "--all" recently (util-linux 2.24-git):

https://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=36c370cbf1
https://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=e05a3400e7
https://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=d6bbe8044b

The only missing feature compared to the shell script Ubuntu ships is detect
when the FS has "discard" in fstab to skip it. Once this is in place, no
shell will be needed at all. Just a one-liner "ExecStart" systemd unit.

--
Marcos

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