This isn’t a fix, but rather a diagnosis of the problem.
First of all, the error looks like it comes from the sudo
process rather than sed
: PAM is a library intended for use by utilities dealing in user authentication.
As we’re dealing with a classic snap, the host system’s libraries are visible. In this case, it appears that libpam has picked up the authentication modules from the host system. One of those modules links to libcrypt.so.1
, and due to the fact the snap is setting LD_LIBRARY_PATH
it ends up trying to load the copy of the library distributed with the snap:
That library appears to be older than the version on the host system, so the PAM module fails to load. This is one of the pitfalls of developing a classic confinement snap compared to strict confinement.
As for this particular case: it is not at all clear why sudo
is being used here. The daemon is already running as root, and has write access to the configuration file in $SNAP_DATA. And if it didn’t, there is no way that sudo could prompt for a password while the daemon is starting.