[artix-general] [s6] autofs-s6

Javier je-vv at e.email
Wed May 12 06:13:59 CEST 2021


On 5/11/21 9:42 PM, Dudemanguy wrote:
> Arch was doing a cleanup of their repos, and we sort of just followed
> suit. It's true that perhaps autofs may still be useful for Artix
> though. I personally use udiskie, but my automounting needs aren't very
> complicated so maybe it's limited in some way I'm not aware of. As for
> the autofs-s6 script, it's planned to be added. Currently, the s6
> backend is undergoing a major refactor/rewrite so after that's settled
> in, the script in universe can be added.

Thanks a lot for answering.

I used udiskie, particularly when I didn't use a DE, just a plain WM, but it works well for physical devices, and only when logged in, again, pretty suitable for a GUI space (I've been using lxqt for some time now, though this might change given its lack of Wayland support)...

Always on a logged in scenario, I use autofs for cifs, and certain sshfs network mounts.  So I can replace autofs for those cases as well.

But I haven't found an alternative for autofs + sshfs on a headless system, for example, I can login remotely, start my ssh agent, start something playing on mpd though its ncmpc client, adjust volume through alsamixer, and then logout, leaving the system without anyone logged in, and playing music, :)  That's why I never liked solutions like pulse audio for example, since once you're logged out, then there's no joy...  Coming back to autofs, I do have some sort of non simple autofs setup.  I don't use ssh directly, but instead something like:

> <mount_sub_dir>  -fstype=sshfs,<some_opts>,ssh_command=ssh-user-agent,reconnect  :<hostname>\:<remote_mount_dir>

where ssh-user-agent contents are something like (it's combined with my ~/.bash_profile and my ~/.xinitrc):

> #!/usr/bin/env bash
> 
> export SSH_ASKPASS=/usr/bin/lxqt-openssh-askpass
> if ! pgrep -u "<username>" ssh-agent > /dev/null; then
>    su <username> -c '/usr/bin/ssh-agent > /tmp/ssh-agent-<username>-env-vars'
>    eval "$(</tmp/ssh-agent-<username>-env-vars)"
> else
>    if [[ "$SSH_AGENT_PID" == "" ]]; then
>       eval "$(</tmp/ssh-agent-<username>-env-vars)"
>    fi  
> fi
> ssh $@

And then I have on /root/.ssh/config:

> Host <hostname>
>   User          <username>
>   IdentityFile  ~<username>/.ssh/<private_key>

This allows me to still keep my ssh private key encrypted, and still use autofs to auto mount with sshfs, being logged out, as long as the ssh agent is up, which it is until a reboot/poweroff.

If there's a simpler, yet secure approach, which doesn't force someone to be always logged in, then I'm willing to try that out...  Particularly if such solutions do not require GUI interfaces either.  I was exploring gvfs for remote locations which I use when logged in any ways, but it's not totally CLI friendly, particularly out of Xorg/Wayland...

On a side note, one thing I like better on the systemd auto mount mechanism, is that the config is /etc/fstab.  I don't see why autofs never tried moving its config there.  It's more intuitive and centralized on /etc/fstab, :)

Thanks a lot !

-- 
Javier

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <https://lists.artixlinux.org/archives/artix-general/attachments/20210511/721faf6d/attachment.sig>


More information about the artix-general mailing list