Help with /bin/bash Error in Script on Zorin OS 18

0
4
Asked By CuriousCoder92 On

Hey everyone! I'm working on a script for Zorin OS 18 and I keep running into this error: '/bin/bash: line 1: /winapps-launcher/winapps-launcher.sh: No such file or directory'. I followed the instructions from the GitHub repository for the WinApps Launcher, but something's definitely off.

Here's the auto-start script I'm trying to set up for systemd:

1. First, create the necessary directory:
`mkdir -p ~/.config/systemd/user`

2. Then, I save my service configuration to:
`~/.config/systemd/user/winapps-launcher.service`

Here's what the service file looks like:
```
[Unit]
Description=Run 'WinApps Launcher'
After=graphical-session.target default.target

[Service]
Type=simple
Environment="PATH=$HOME/.local/bin:$HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Environment="LIBVIRT_DEFAULT_URI=qemu:///system"
Environment="SCRIPT_PATH=$WINAPPS_SRC_DIR/winapps-launcher/winapps-launcher.sh"
Environment="LANG=C"
ExecStart=/bin/bash -c "$SCRIPT_PATH"
ExecStopPost=/bin/bash -c 'echo "[SYSTEMD] WINAPPS LAUNCHER SERVICE EXITED."'
TimeoutStartSec=5
TimeoutStopSec=5
Restart=on-failure
RestartSec=5

[Install]
WantedBy=default.target
```

The full console log indicates that the service tries to run but fails with exit code 127. I've confirmed that the scripts exist in the right place when I run them manually in the terminal. Any ideas on what I might be doing wrong?

3 Answers

Answered By UserHelp101 On

Double-check the value of `$WINAPPS_SRC_DIR` when the service is running. You can verify this with `systemctl --user status winapps-launcher`. Make sure that the path resolves correctly during execution.

Answered By ScriptMaster5000 On

If you've confirmed that the script works fine when run manually, you might want to ensure that the service has the right permissions to access that path. Sometimes, creating a system-wide install path can make a difference if permissions are causing issues.

Answered By TechSavvy123 On

It looks like you're trying to reference a variable in your systemd service file with `$WINAPPS_SRC_DIR`, but systemd won't expand that variable. Try using the absolute path to the script instead. That should resolve the 'No such file or directory' issue.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.