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
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.
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.
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
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures