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

Failed at step EXEC spawning #7

Closed
petrstepanov opened this issue Jan 20, 2022 · 5 comments
Closed

Failed at step EXEC spawning #7

petrstepanov opened this issue Jan 20, 2022 · 5 comments

Comments

@petrstepanov
Copy link

petrstepanov commented Jan 20, 2022

Dear Patrik,

First I would like to thank you for this great piece of software! Your RAMDisk is a savior. Recently I ran into an issue with starting the service. I use Fedora 35 with 5.15.14 kernel.

The output of the command sudo p3x-ramdisk start petrstepanov is following:

Job for p3x-ramdisk-petrstepanov.service failed because the control process exited with error code.

Below I attach the listing of the systemctl status p3x-ramdisk-petrstepanov.service command:

Jan 19 23:34:22 fedora systemd[1]: Starting P3X ramdisk petrstepanov persistent...
Jan 19 23:34:22 fedora systemd[15876]: p3x-ramdisk-petrstepanov.service: Failed to locate executable /home/petrstepanov/.p3x-ramdisk/p3x-ramdisk.sh: Permission denied
Jan 19 23:34:22 fedora systemd[15876]: p3x-ramdisk-petrstepanov.service: Failed at step EXEC spawning /home/petrstepanov/.p3x-ramdisk/p3x-ramdisk.sh: Permission denied
Jan 19 23:34:22 fedora systemd[1]: p3x-ramdisk-petrstepanov.service: Control process exited, code=exited, status=203/EXEC
Jan 19 23:34:22 fedora systemd[1]: p3x-ramdisk-petrstepanov.service: Failed with result 'exit-code'.
Jan 19 23:34:22 fedora systemd[1]: Failed to start P3X ramdisk petrstepanov persistent.

Also, the journalctl -xeu p3x-ramdisk-petrstepanov.service command provides following output:

░░ A start job for unit p3x-ramdisk-petrstepanov.service has begun execution.
░░ 
░░ The job identifier is 10492.
Jan 19 23:34:22 fedora systemd[15876]: p3x-ramdisk-petrstepanov.service: Failed to locate executable /home/petrstepanov/.p3x-ramdisk/p3x-ramdisk.sh: Permission denied
░░ Subject: Process /home/petrstepanov/.p3x-ramdisk/p3x-ramdisk.sh could not be executed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The process /home/petrstepanov/.p3x-ramdisk/p3x-ramdisk.sh could not be executed and failed.
░░ 
░░ The error number returned by this process is ERRNO.
Jan 19 23:34:22 fedora systemd[15876]: p3x-ramdisk-petrstepanov.service: Failed at step EXEC spawning /home/petrstepanov/.p3x-ramdisk/p3x-ramdisk.sh: Permission denied
░░ Subject: Process /home/petrstepanov/.p3x-ramdisk/p3x-ramdisk.sh could not be executed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The process /home/petrstepanov/.p3x-ramdisk/p3x-ramdisk.sh could not be executed and failed.
░░ 
░░ The error number returned by this process is ERRNO.
Jan 19 23:34:22 fedora systemd[1]: p3x-ramdisk-petrstepanov.service: Control process exited, code=exited, status=203/EXEC
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ An ExecStartPre= process belonging to unit p3x-ramdisk-petrstepanov.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 203.
Jan 19 23:34:22 fedora systemd[1]: p3x-ramdisk-petrstepanov.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit p3x-ramdisk-petrstepanov.service has entered the 'failed' state with result 'exit-code'.
Jan 19 23:34:22 fedora systemd[1]: Failed to start P3X ramdisk petrstepanov persistent.
░░ Subject: A start job for unit p3x-ramdisk-petrstepanov.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit p3x-ramdisk-petrstepanov.service has finished with a failure.
░░ 
░░ The job identifier is 10492 and the job result is failed.

Things were working fine before. But probably after a recent system update the service is not starting anymore. So obviously the systemd cannot execute p3x-ramdisk.sh script located in the home folder. I ran into this post on StackExchange. It says the script has to be installed system-wide.

Please let me know if you can provide any help here. Thank you again for the RAMDisk!

@p3x-robot
Copy link
Member

fix the Permission denied problem. something you did wrong. right now in a project very soon done, i will might check if it works on my machine. dont use feroda, but check the unit why is not giving permission for that shell script.

@petrstepanov
Copy link
Author

Hi Patrik, it turned out that the systemd unit does a lot of confining for the service. In particular, it denied is access to user's home directories. Therefore, my solution was to copy the p3x-ramdisk.sh script to /usr/bin/. Apparently, script path in the service files ~/.p3x-ramdisk/*.service needs to be tweaked:

sed -i "s;${HOME}/.p3x-ramdisk/;;" ~/.p3x-ramdisk/*.service
sudo cp ${HOME}/.p3x-ramdisk/p3x-ramdisk.sh /usr/bin/

I am fine with this workaround now. Maybe in future consider making this fix permanent.

@p3x-robot
Copy link
Member

ok, i provide an option soon, right now sick, so it might take 1 2 weeks to implememt, thanks!

@petrstepanov
Copy link
Author

Thank you. Feel better soon!

@p3x-robot
Copy link
Member

did you do it using as a root user? it is intended to work with other than root.
i added a systemd unit user that provide the user. please try. but do not use in root. always use it via sudo as it the description saya.
not su and not sudo -i, but as it says. it should, otherwise it is a permission issue, which chmod and chown is enough. i suppose.

https://github.com/patrikx3/ramdisk#setup

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

No branches or pull requests

2 participants