Re: [systemd-devel] systemd.automount issue: Failed to initialize automounter: Operation not permitted

2020-11-16 Thread Mantas Mikulėnas
Automounts themselves are established by a magic kernel-level mount
(specifically they're "autofs" mounts), which requires root privileges.

Your systemd --user instance runs unprivileged, as your own UID, and
doesn't have the privilege to mount autofs (or anything else that isn't
FUSE).

On Tue, Nov 17, 2020, 00:01 Wolter HV  wrote:

>
>
> Hello,
>
> I'm trying to mount an sshfs share using systemd only, on a user level.
> Unfortunately, I get the following error message on journalctl:
>
> Failed to initialize automounter: Operation not permitted
>
> I get that error message on journalctl after I try to start my automount
> via the command
>
> systemctl --user start home-anonymous-mountpoint.automount
>
> Please find the full log and unit files below.
>
> However, if I run instead
>
> systemctl --user start home-anonymous-mountpoint.mount
>
> then the mount works fine.
>
> This is the detailed log:
>
> --- LOG ---
> [REDACTED] systemd: home-anonymous-mountpoint.automount: Failed to
> initialize automounter: Operation not permitted
> [REDACTED] systemd: home-anonymous-mountpoint.automount: Failed with
> result 'resources'.
>Subject: Unit failed
>Defined-By: systemd
>Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
>The unit UNIT has entered the 'failed' state with result 'resources'.
> [REDACTED] systemd: Failed to set up automount remotelocation at
> remotehost.
>Subject: A start job for unit UNIT has failed
>Defined-By: systemd
>Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
>A start job for unit UNIT has finished with a failure.
>
>The job identifier is 272 and the job result is failed.
> --- EOF ---
>
> These are my unit files:
>
> --- ~/.config/systemd/user/home-anonymous-mountpoint.automount ---
> [Unit]
> Description=remotelocation at remotehost
>
> [Automount]
> Where=/home/anonymous/mountpoint
> TimeoutIdleSec=600
>
> [Install]
> WantedBy=default.target
> --- EOF ---
>
> --- ~/.config/systemd/user/home-anonymous-mountpoint.mount ---
> [Mount]
> What=remoteuser@remotehost:/srv/sshfs/remotelocation
> Type=fuse.sshfs
> Options=IdentityFile=/home/anonymous/.ssh/keys/remotehost-remoteuser.id_rsa
> TimeoutSec=10
> --- EOF ---
>
> (Crossing my fingers so this message doesn't get garbled or force-wrapped.)
>
> Regards,
>
> Wolter HV
>
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] systemd.automount issue: Failed to initialize automounter: Operation not permitted

2020-11-16 Thread Wolter HV



Hello,

I'm trying to mount an sshfs share using systemd only, on a user level. 
Unfortunately, I get the following error message on journalctl:

Failed to initialize automounter: Operation not permitted

I get that error message on journalctl after I try to start my automount via 
the command

systemctl --user start home-anonymous-mountpoint.automount

Please find the full log and unit files below.

However, if I run instead

systemctl --user start home-anonymous-mountpoint.mount

then the mount works fine.

This is the detailed log:

--- LOG ---
[REDACTED] systemd: home-anonymous-mountpoint.automount: Failed to initialize 
automounter: Operation not permitted
[REDACTED] systemd: home-anonymous-mountpoint.automount: Failed with result 
'resources'.
   Subject: Unit failed
   Defined-By: systemd
   Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel

   The unit UNIT has entered the 'failed' state with result 'resources'.
[REDACTED] systemd: Failed to set up automount remotelocation at remotehost.
   Subject: A start job for unit UNIT has failed
   Defined-By: systemd
   Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel

   A start job for unit UNIT has finished with a failure.

   The job identifier is 272 and the job result is failed.
--- EOF ---

These are my unit files:

--- ~/.config/systemd/user/home-anonymous-mountpoint.automount ---
[Unit]
Description=remotelocation at remotehost

[Automount]
Where=/home/anonymous/mountpoint
TimeoutIdleSec=600

[Install]
WantedBy=default.target
--- EOF ---

--- ~/.config/systemd/user/home-anonymous-mountpoint.mount ---
[Mount]
What=remoteuser@remotehost:/srv/sshfs/remotelocation
Type=fuse.sshfs
Options=IdentityFile=/home/anonymous/.ssh/keys/remotehost-remoteuser.id_rsa
TimeoutSec=10
--- EOF ---

(Crossing my fingers so this message doesn't get garbled or force-wrapped.)

Regards,

Wolter HV


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