`ecryptfs-setup-swap` gives error when `/etc/init.d` does not exist
Description:
The ecryptfs-setup-swap
utility will give an error on Arch Linux due to Arch not having an /etc/init.d
. Running $ sudo ecryptfs-setup-swap
on my machine gives the following output:
WARNING:
An encrypted swap is required to help ensure that encrypted files are not leaked to disk in an unencrypted format.
HOWEVER, THE SWAP ENCRYPTION CONFIGURATION PRODUCED BY THIS PROGRAM WILL BREAK HIBERNATE/RESUME ON THIS SYSTEM!
NOTE: Your suspend/resume capabilities will not be affected.
Do you want to proceed with encrypting your swap? [y/N]: y
INFO: Setting up swap: [/dev/nvme0n1p2]
WARNING: Commented out your unencrypted swap from /etc/fstab
/usr/bin/ecryptfs-setup-swap: line 197: /etc/init.d/cryptdisks: No such file or directory
Looking at /usr/bin/ecryptfs-setup-swap
, it is clear the issue comes from line 197:
/etc/init.d/cryptdisks restart
I know this is technically an upstream issue, but I think that software which specifically throws an error on Arch Linux is also a packaging issue. From a quick search it seems like this is a Debian specific thing? I'm not sure if the solution is to stop including this script in the package or what, but I thought to bring this to the Arch devs' attention, and if you decide this is not within the scope of Arch packaging that's fair enough. I guess another option would be just removing lines 192–201:
if [ "$NO_RELOAD" != 1 ]; then
# Turn swap off
swapoff -a
# Restart cryptdisks
/etc/init.d/cryptdisks restart
# Turn the swap on
swapon -a
fi
But I assume modifying a packaged script is beyond the scope of Arch devs' responsibilities.
Additional info:
- package version(s): 111-8
- config and/or log files: N/A that I'm aware of
- link to upstream bug report, if any: N/A that I'm aware of
Steps to reproduce:
- Have an unencrypted swap partition or file
- Install
ecryptfs-utils
on Arch Linux with$ sudo pacman -S ecryptfs-utils
- Run
$ sudo ecryptfs-setup-swap