Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd-swap fails to start as service (exit code 203) #195

Open
tlonic opened this issue Jan 3, 2021 · 3 comments
Open

systemd-swap fails to start as service (exit code 203) #195

tlonic opened this issue Jan 3, 2021 · 3 comments

Comments

@tlonic
Copy link

tlonic commented Jan 3, 2021

I'm on Arch, running the latest version of systemd-swap in community.

When I try to start the systemd-swap service, it fails.

  • systemd-swap.service - Manage swap spaces on zram, files and partitions.
    Loaded: loaded (/usr/lib/systemd/system/systemd-swap.service; enabled; vendor preset: disabled)
    Active: failed (Result: exit-code) since Sun 2021-01-03 13:16:29 EST; 43s ago
    Process: 1236 ExecStart=/usr/bin/systemd-swap start (code=exited, status=203/EXEC)
    Main PID: 1236 (code=exited, status=203/EXEC)

Jan 03 13:16:29 valine systemd[1]: Starting Manage swap spaces on zram, files and partitions....
Jan 03 13:16:29 valine systemd[1236]: systemd-swap.service: Failed to execute /usr/bin/systemd-swap: Operation not permitted
Jan 03 13:16:29 valine systemd[1236]: systemd-swap.service: Failed at step EXEC spawning /usr/bin/systemd-swap: Operation not permitted
Jan 03 13:16:29 valine systemd[1]: systemd-swap.service: Main process exited, code=exited, status=203/EXEC
Jan 03 13:16:29 valine systemd[1]: systemd-swap.service: Failed with result 'exit-code'.
Jan 03 13:16:29 valine systemd[1]: Failed to start Manage swap spaces on zram, files and partitions..

However, running systemd-swap manually works perfectly.

# systemd-swap start
INFO: Removing working directory...
INFO: Removing files in /mnt/Media/swapfc/...
INFO: Zswap: backup current configuration: start
INFO: Zswap: backup current configuration: complete
INFO: Zswap: set new parameters: start
INFO: Zswap: Enable: 1, Comp: zstd, Max pool %: 25, Zpool: z3fold
INFO: Zswap: set new parameters: complete
INFO: Writing destroy info...
INFO: swapD: pick up devices from systemd-gpt-auto-generator
INFO: swapD: searching swap devices
INFO: swapFC: on-demand swap activation at >5055 MiB memory usage

@vilgotf
Copy link
Contributor

vilgotf commented Jan 3, 2021

"Operation not permitted", could you run it in debug mode and post output when it fails?
https://github.com/Nefelim4ag/systemd-swap/blob/b00c92864fd9258a072181c23300e28f2a071e5f/src/systemd-swap.py#L63

@blacklight
Copy link

Same issue here - also occurring on Arch Linux:

$ sudo systemctl start systemd-swap.service
Job for systemd-swap.service failed because the control process exited with error code.
See "systemctl status systemd-swap.service" and "journalctl -xe" for details.

$ sudo systemctl status systemd-swap.service
● systemd-swap.service - Manage swap spaces on zram, files and partitions.
     Loaded: loaded (/usr/lib/systemd/system/systemd-swap.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Fri 2021-02-19 21:36:36 CET; 3s ago
    Process: 6626 ExecStart=/usr/bin/systemd-swap start (code=exited, status=203/EXEC)
   Main PID: 6626 (code=exited, status=203/EXEC)

Feb 19 21:36:36 volta systemd[1]: Starting Manage swap spaces on zram, files and partitions....
Feb 19 21:36:36 volta systemd[6626]: systemd-swap.service: Failed to execute /usr/bin/systemd-swap: Operation not permitted
Feb 19 21:36:36 volta systemd[6626]: systemd-swap.service: Failed at step EXEC spawning /usr/bin/systemd-swap: Operation not permitted
Feb 19 21:36:36 volta systemd[1]: systemd-swap.service: Main process exited, code=exited, status=203/EXEC
Feb 19 21:36:36 volta systemd[1]: systemd-swap.service: Failed with result 'exit-code'.
Feb 19 21:36:36 volta systemd[1]: Failed to start Manage swap spaces on zram, files and partitions..

Note that the output above is printed with IS_DEBUG=True, no extra debug lines are available.

When I start it through the systemd-swap executable everything works fine though.

@oold
Copy link
Collaborator

oold commented Jan 3, 2022

I did some searching and the issue could be that python3 is not where the script expects it to be, which would be /usr/bin/python3. Could also be something with SELinux or the file not having executable permissions. Whatever it is, it fails when trying to spawn the process with execve().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants