Re: [systemd-devel] Does systemctl unmask enables a service also?

2021-07-17 Thread Mantas Mikulėnas
On Sat, Jul 17, 2021, 22:23 Debraj Manna  wrote:

> Hi
>
> I have read this article
>  and it appears to
> me that unmasking and starting a service should also enable it back. But on
> trying it does not appear to happen like that
>
> ubuntu@vrni-platform:~$ sudo systemctl status flinkjobs.service
> ● flinkjobs.service - Flinkjobs Service
>Loaded: loaded (/usr/lib/systemd/system/flinkjobs.service; *disabled*;
> vendor preset: enabled)
>

Well, in your case it wasn't actually enabled in the first place...
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Does systemctl unmask enables a service also?

2021-07-17 Thread Andrei Borzenkov
On 17.07.2021 22:22, Debraj Manna wrote:
> 
> Should not unmasking and starting a service also make it enabled?
> 

No. Starting/stopping, enabling/disabling and masking/unmasking are
orthogonal operations.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Does systemctl unmask enables a service also?

2021-07-17 Thread Debraj Manna
Hi

I have read this article
 and it appears to me
that unmasking and starting a service should also enable it back. But on
trying it does not appear to happen like that

ubuntu@vrni-platform:~$ sudo systemctl status flinkjobs.service
● flinkjobs.service - Flinkjobs Service
   Loaded: loaded (/usr/lib/systemd/system/flinkjobs.service; disabled;
vendor preset: enabled)
   Active: active (running) since Sat 2021-07-17 18:27:38 UTC; 26min ago
 Main PID: 23321 (bash)
Tasks: 4 (limit: 4915)
   CGroup: /system.slice/flinkjobs.service
...

*Stopped and masked a service*

ubuntu@vrni-platform:~$ sudo service flinkjobs stop
ubuntu@vrni-platform:~$ sudo systemctl mask flinkjobs.service
Created symlink /etc/systemd/system/flinkjobs.service → /dev/null.
ubuntu@vrni-platform:~$ sudo service flinkjobs status
● flinkjobs.service
   Loaded: masked (/dev/null; bad)
   Active: inactive (dead) since Sat 2021-07-17 19:00:33 UTC; 1min 54s ago
 Main PID: 23321 (code=killed, signal=TERM)

*Unmasked and started a service*
ubuntu@vrni-platform:~$ sudo systemctl unmask flinkjobs.service
Removed /etc/systemd/system/flinkjobs.service.
ubuntu@vrni-platform:~$ sudo service flinkjobs start
ubuntu@vrni-platform:~$ sudo service flinkjobs status
● flinkjobs.service - Flinkjobs Service
   Loaded: loaded (/usr/lib/systemd/system/flinkjobs.service; disabled;
vendor preset: enabled)
   Active: active (running) since Sat 2021-07-17 19:02:53 UTC; 10s ago
 Main PID: 7958 (bash)
Tasks: 19 (limit: 4915)
   CGroup: /system.slice/flinkjobs.service
...

But if I do is-enabled it is showing the service as disabled

ubuntu@vrni-platform:~$ sudo systemctl is-enabled  flinkjobs.service
disabled

Should not unmasking and starting a service also make it enabled?

ubuntu@vrni-platform:~$ systemctl --version
systemd 237
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP
+GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN
-PCRE2 default-hierarchy=hybrid

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


[systemd-devel] --luks-offline-discard option has no effect on systemd-homed

2021-07-17 Thread Gibeom Gwon

Hello,

I'm trying to create a systemd-homed based user, there is a problem with
--luks-offline-discard option. According to homectl(1), if this option 
is true,

home directory loopback file is minified on logout. But in my case it's not
at all. Here is my executed command and output.

# df -h
Filesystem    Size  Used Avail Use% Mounted on
devtmpfs  3.9G 0  3.9G   0% /dev
tmpfs 3.9G  1.1M  3.9G   1% /dev/shm
tmpfs 1.6G  9.5M  1.6G   1% /run
/dev/mapper/root  234G  118G  105G  53% /
tmpfs 3.9G  220K  3.9G   1% /tmp
/dev/sda1 191M   62M  130M  33% /boot
tmpfs 787M   60K  787M   1% /run/user/60448
# homectl create test --storage=luks --luks-offline-discard=yes
 Please enter new password for user test: 
 Please enter new password for user test (repeat): 
# homectl inspect test
   User name: test
   State: inactive
 Disposition: regular
 Last Change: Sat 2021-07-17 23:18:05 KST
    Login OK: yes
 Password OK: yes
 UID: 60444
 GID: 60444 (test)
   Directory: /home/test
 Storage: luks (strong encryption)
  Image Path: /home/test.home
   Removable: no
   Shell: /bin/bash
LUKS Discard: online=no offline=yes
   LUKS UUID: dd4ffd2f0e334280945af86f6d64906d
   Part UUID: 64c13ffc40b74a8594bb10f6523d0548
 FS UUID: 2d39d33d882e450dbab52c516b8bcbb5
 File System: btrfs
 LUKS Cipher: aes
 Cipher Mode: xts-plain64
  Volume Key: 256bit
 Mount Flags: nosuid nodev exec
   Disk Size: 88.5G
  Disk Floor: 256.0M
Disk Ceiling: 104.2G
 Auth. Limit: 30 attempts per 1min
   Passwords: 1
  Local Sig.: yes
 Service: io.systemd.Home
# df -h
Filesystem    Size  Used Avail Use% Mounted on
devtmpfs  3.9G 0  3.9G   0% /dev
tmpfs 3.9G  1.1M  3.9G   1% /dev/shm
tmpfs 1.6G  9.5M  1.6G   1% /run
/dev/mapper/root  234G  206G   16G  93% /
tmpfs 3.9G  220K  3.9G   1% /tmp
/dev/sda1 191M   62M  130M  33% /boot
tmpfs 787M   60K  787M   1% /run/user/60448
# homectl activate test
 Please enter password for user test: 
# df -h
Filesystem Size  Used Avail Use% Mounted on
devtmpfs   3.9G 0  3.9G   0% /dev
tmpfs  3.9G  1.1M  3.9G   1% /dev/shm
tmpfs  1.6G  9.5M  1.6G   1% /run
/dev/mapper/root   234G  206G   16G  93% /
tmpfs  3.9G  220K  3.9G   1% /tmp
/dev/sda1  191M   62M  130M  33% /boot
tmpfs  787M   60K  787M   1% /run/user/60448
/dev/mapper/home-test   89G  3.4M   89G   1% /home/test
# homectl deactivate test
# df -h
Filesystem    Size  Used Avail Use% Mounted on
devtmpfs  3.9G 0  3.9G   0% /dev
tmpfs 3.9G  1.1M  3.9G   1% /dev/shm
tmpfs 1.6G  9.5M  1.6G   1% /run
/dev/mapper/root  234G  206G   16G  93% /
tmpfs 3.9G  220K  3.9G   1% /tmp
/dev/sda1 191M   62M  130M  33% /boot
tmpfs 787M   60K  787M   1% /run/user/60448

As you can see the home directory doesn't shrink even when deactivated
after activated. The systemd-homed debug log says, "File system does
not support FITRIM, not trimming.".

Note that my system's root directory is encrypted with LUKS2 and LVM
is not used. I'm not sure is this a bug of systemd or limitation of the 
kernel.

Is there any way to solve this?

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