Score:0

Permission denied when attempting to run the binary from /usr/bin on bootup

cn flag
xyf

I am writing a service that shall run a binary sitting in /usr/bin however on bootup, I see the service kicks in however the binary fails to run due to permission issues.

/etc/rc5.d/S99_ServiceFile: line 30: /usr/bin/<binary>: Permission denied

I could manually run the binary after running

mount / -o rw,remount
$/usr/bin/ chmod a+x <binary>
$/usr/bin ./<binary>

but the setting doesn't remain intact forever (after restarting...).

raj avatar
cn flag
raj
If I understand you correctly the problem is that `/usr/bin/<binary>` doesn't have the `x` permission at bootup, and after setting this permission the change doesn't persist after reboot? This seems very strange. Which binary it is?
xyf avatar
cn flag
xyf
OK figured out: the permissions of the binary in the source code wasn't kept intact in the result rootfs image. Using fakeroot to copy the file and build it did the trick
BeastOfCaerbannog avatar
ca flag
Glad to know that you solved your issue! Could you please post the solution as an answer?
Score:0
cn flag
xyf

The issue really was the permissions of the file weren't maintained as the file was copied hence permission issues. The trick really was to use fakeroot to copy the file and build

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.