pimalaya / himalaya

CLI to manage emails
https://pimalaya.org
MIT License
3.17k stars 95 forks source link

Not receiving a notification #394

Closed davidhaley closed 2 years ago

davidhaley commented 2 years ago

out

I set up a systemd service to run himalaya notify; however, I don't receive a notification (even though the logs mention that it is running the command). If I run /usr/bin/notify-send subject body I receive a notification.

Here is the service:

[Unit]
Description=Himalaya Notify

[Service]
Type=simple
ExecStart=/home/dhw/wkspaces/personal/dev_config_ubuntu/start_himalaya_notify.sh
ProtectHome=off
Environment="HOME=/home/dhw"

[Install]
WantedBy=multi-user.target

And the script that it runs:

#!/bin/bash

RUST_LOG=trace /home/dhw/.local/bin/himalaya notify

Thank you.

soywod commented 2 years ago

Could you try with a more minimalist config (see https://github.com/soywod/himalaya/wiki/Usage:msg:notify) to see if it works for you? Try also to set directly the himalaya notify inside the systemd service to see. Let me know!

davidhaley commented 2 years ago

Thank you for your help!

I receive a notification if I run himalaya notify directly in the terminal and send myself an email.

However, I used the example service and stored it in the example location, set the executable bit, and I receive a (code=exited, status=203/EXEC) from systemd upon starting the service.

[Unit]
Description=Himalaya new messages notifier

[Service]
ExecStart=himalaya notify
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

image image

This isn't related to himalaya, so we can close this issue if you want. I will tinker and try to figure it out (I can post the solution here once I've found it).

Cheers!

davidhaley commented 2 years ago

Figured it out, I needed to add the full path to the executable.

[Unit]
Description=Himalaya new messages notifier

[Service]
ExecStart=/home/dhw/.local/bin/himalaya notify
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

It's working now. Thank you!

soywod commented 2 years ago

Awesome, glad to hear you made it work! Feel free to edit the wiki if you find it pertinent (for eg adding an absolute path to himalaya) to prevent future users deeling with the same issue!