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

Hook scripts are not executed #31

Open
joseon-penggwin opened this issue Dec 13, 2019 · 5 comments
Open

Hook scripts are not executed #31

joseon-penggwin opened this issue Dec 13, 2019 · 5 comments

Comments

@joseon-penggwin
Copy link

Hi,

I installed dockd according to the readme and have it running now.

Although, the dock and undock scripts are not working.

The scripts are executeable and work well when I call them manually, but don't work when I let them call automatically through dockd.

/etc/dockd$ ls -la
total 32
drwxr-xr-x   2 root root  4096 Dez 13 11:56 .
drwxr-xr-x 147 root root 12288 Dez 13 11:12 ..
-rw-r--r--   1 root root   342 Dez 13 11:17 docked.conf
-rwxr--r--   1 root root   587 Dez 13 11:56 dock.hook
-rw-r--r--   1 root root   272 Dez 13 11:19 undocked.conf
-rwxr--r--   1 root root   283 Dez 13 11:56 undock.hook

My dock.hook and undock.hook respectively look like this:

...
echo "Docking at: " $(date) >> /home/user/Desktop/test
...

Alas, both don't work.

Lenovo T480s, Xubuntu 18.04

If there's anything you need, just ask.

@dkim286
Copy link

dkim286 commented Apr 8, 2020

I'm experiencing the same issue on X220. I made a quick and dirty fix (#33) and waiting for the maintainer's input.

@smclt30p
Copy link
Member

smclt30p commented Apr 8, 2020 via email

@dkim286
Copy link

dkim286 commented Apr 8, 2020

Thanks for the reply. At least on my end, the hooks are already executable, but they're owned by the root user and it's preventing the script from being run:

Apr 08 14:07:57 lateralus dockd[3694167]: Dock hook exited with non-zero value (32256)

I'm not sure how this can be avoided as dockd needs to be run with superuser permissions to write to /etc/dockd/ when configuring. The only workaround I can think of is running the hooks as file args for bash or manually marking them as executable for all users, the latter being less than ideal.

@smclt30p
Copy link
Member

smclt30p commented Apr 9, 2020 via email

@dkim286
Copy link

dkim286 commented Apr 10, 2020

My local copy of dockd is from AUR fetched via auracle. I noticed that the original hook files in dockd-1.21.tar.gz have their permissions set as "intended":

-rwxr-xr-x 1 username username   222 Jan 19  2018 dock.hook
-rwxr-xr-x 1 username username   224 Jan 19  2018 undock.hook

...as opposed to what they're actually set to under /etc/dockd, which matches the original post's.
I suspect this is caused by permissions not being preserved at installation time and probably outside dockd's control.

In the meantime, I decided to just change my own hook files to match the intended permissions. No more hook problems.

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

3 participants