Fresh install: several issues. (Touchpad behaves strangely, performance issues)

Hello! I just installed Garuda Linux onto a Dynabook Portege X50-G. I am also running tlp if that helps. Here's my inxi below:

System:
  Kernel: 5.15.74-1-lts arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-lts
    root=UUID=1f623fc4-c2f5-4466-814d-7bf5acec1bc7 rw [email protected]
    quiet quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
    resume=UUID=ed586f59-3328-4a0d-bfc3-f277bbdc5f9f loglevel=3
  Desktop: Cinnamon v: 5.4.12 tk: GTK v: 3.24.34 wm: Mutter vt: 7
    dm: LightDM v: 1.32.0 Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Laptop System: Dynabook product: dynabook PORTEGE X50-G
    v: PLR41U-066006 serial: <superuser required> Chassis: type: 10
    v: Version 1.0 serial: <superuser required>
  Mobo: Dynabook model: A0106/0002 v: Version A0
    serial: <superuser required> UEFI: Dynabook v: Version 2.20
    date: 04/19/2021
Battery:
  ID-1: BAT1 charge: 32.8 Wh (73.2%) condition: 44.8/46.5 Wh (96.3%)
    volts: 0.1 min: 11.4 model: G71C000LU111 type: Li-ion serial: <filter>
    status: discharging
CPU:
  Info: model: Intel Core i7-10510U bits: 64 type: MT MCP
    arch: Comet/Whiskey Lake note: check gen: core 10 level: v3 note: check
    built: 2018 process: Intel 14nm family: 6 model-id: 0x8E (142)
    stepping: 0xC (12) microcode: 0xF0
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
    L3: 8 MiB desc: 1x8 MiB
  Speed (MHz): avg: 931 high: 1000 min/max: 400/4900 scaling:
    driver: intel_pstate governor: powersave cores: 1: 1000 2: 1000 3: 950
    4: 900 5: 900 6: 900 7: 900 8: 900 bogomips: 36799
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
  Type: retbleed mitigation: Enhanced IBRS
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl and seccomp
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Enhanced IBRS, IBPB: conditional, RSB
    filling, PBRSB-eIBRS: SW sequence
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel CometLake-U GT2 [UHD Graphics] driver: i915 v: kernel
    arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports: active: eDP-1
    empty: DP-1,DP-2 bus-ID: 00:02.0 chip-ID: 8086:9b41 class-ID: 0300
  Device-2: Chicony TOSHIBA Web Camera - HD type: USB driver: uvcvideo
    bus-ID: 1-7:2 chip-ID: 04f2:b689 class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.4 driver: X: loaded: modesetting
    alternate: fbdev,intel,vesa dri: iris gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: eDP-1 model: Sharp 0x14c4 built: 2019 res: 1920x1080 hz: 60
    dpi: 142 gamma: 1.2 size: 344x194mm (13.54x7.64") diag: 395mm (15.5")
    ratio: 16:9 modes: 1920x1080
  Message: Unable to show GL data. Required tool glxinfo missing.
Audio:
  Device-1: Intel Comet Lake PCH-LP cAVS driver: snd_hda_intel v: kernel
    alternate: snd_soc_skl,snd_sof_pci_intel_cnl bus-ID: 00:1f.3
    chip-ID: 8086:02c8 class-ID: 0403
  Sound API: ALSA v: k5.15.74-1-lts running: yes
  Sound Server-1: PulseAudio v: 16.1 running: no
  Sound Server-2: PipeWire v: 0.3.59 running: yes
Network:
  Device-1: Intel Comet Lake PCH-LP CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:02f0 class-ID: 0280
  IF: wlo1 state: up mac: <filter>
Bluetooth:
  Device-1: Intel AX201 Bluetooth type: USB driver: btusb v: 0.8
    bus-ID: 1-10:4 chip-ID: 8087:0026 class-ID: e001
  Report: bt-adapter ID: hci0 rfk-id: 1 state: down
    bt-service: enabled,running rfk-block: hardware: no software: yes
    address: <filter>
Drives:
  Local Storage: total: 476.94 GiB used: 12.84 GiB (2.7%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung
    model: MZVLB512HBJQ-00007 size: 476.94 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: EXF7202Q temp: 36.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 459.73 GiB size: 459.73 GiB (100.00%) used: 12.84 GiB
    (2.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%) used: 608 KiB
    (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 459.73 GiB size: 459.73 GiB (100.00%) used: 12.84
    GiB (2.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-4: /var/log raw-size: 459.73 GiB size: 459.73 GiB (100.00%) used: 12.84
    GiB (2.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-5: /var/tmp raw-size: 459.73 GiB size: 459.73 GiB (100.00%) used: 12.84
    GiB (2.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 16.91 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme0n1p3 maj-min: 259:3
  ID-2: swap-2 type: zram size: 15.38 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 43.0 C pch: 44.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 297 Uptime: 7m wakeups: 957 Memory: 15.38 GiB used: 2.11 GiB
  (13.7%) Init: systemd v: 251 default: graphical tool: systemctl
  Compilers: gcc: 12.2.0 Packages: pm: pacman pkgs: 1512 libs: 516
  tools: octopi,paru Shell: fish v: 3.5.1 default: Bash v: 5.1.16
  running-in: gnome-terminal inxi: 3.3.22
Garuda (2.6.9-1):
  System install date:     2022-10-22
  Last full system update: 2022-10-23
  Is partially upgraded:   No
  Relevant software:       NetworkManager
  Windows dual boot:       No/Undetected
  Snapshots:               Snapper
  Failed units:            

I have several issues with the installation. One of them is that upon certain startups, or waking up from hibernation, my laptop runs extremely laggy, as in there's a huge delay when I type, and my touchpad becomes almost unusable, sometimes when I move it, it stops after a while and clicks by itself, even though I haven't pressed down on the touchpad. Sometimes a restart solves this issue, but it is very annoying, and I can't seem to predict when it will and won't happen. My touchpad buttons also won't work, the laptop has dedicated left/right click buttons but pressing them doesn't do anything. I have to click on the touchpad itself.

Other than these issues, and a couple of minor ones I don't mind, Garuda runs fantastically when it does run well. Any tips, or stuff I can try? It's pretty annoying to have to restart the laptop every few minutes. If I need to clarify anything, please let me know. ^^

Thanks in advance!

Certain CPU/motherboard/kernel combinations do not emerge from "deep" suspend states gracefully. Post the output of:

cat /sys/power/mem_sleep

My guess is it will say [deep]. Changing it to [s2idle] may resolve the issue, but you will get worse suspend battery life.

I am not sure how tlp might play into the equation, but I would suggest disabling or uninstalling it to test if you notice any difference.

In general, or just after suspend? If it is a suspend-related issue, test to see if you can bring them back:

sudo rmmod hid_multitouch
sudo modprobe hid_multitouch

Another consideration would be to disable PS/2 emulation in the BIOS and see if that helps.

4 Likes

It doesn't seem to be an issue with tlp, as I get the same touchpad issues even with other distros. :frowning: For the touchpad buttons, it's in general. They don't do anything at all, also unfortunately my bios lacks the option to disable PS2 emulation.

The output of cat /sys/power/mem_sleep is: [s2idle] deep

(oops, wasnt aware there was a firedragon section, I'll post my problem in that)

Too bad, this looks like a long-standing issue with this series of laptops. There is a bug report here, specifically for X30/X40 but the issue with the buttons sounds the same.

Someone wrote a program in Go to get the buttons (and the "accupoint" device) working, check it out: GitHub - GRbit/acupoint-portege-x30: Userspace driver for toshiba portege x30-f accupoint device

The installation instructions are written for Ubuntu and Fedora, but they appear to be just setting up dependencies. With some effort you could probably get it working. It seems a little hacky, but hey! :man_shrugging:

I think it would be helpful to try some other kernels, both for the touchpad/button issue and for the resume issue. Try linux or linux-mainline.

To install another kernel, first bring your system fully up to date:

garuda-update

Then install the kernel and headers. The linux kernel, for example:

sudo pacman -S linux linux-headers

Reboot, then on the Grub menu select advanced boot options and pick the new kernel.

4 Likes

The go program works! The only thing is that for some odd reason, the buttons stop working once I turn off the computer. Is there any way to make the effects permanent, or to run the command upon startup?

Also, I switched to the zen and linux kernels. I still get the same issue, unfortunately... I can confirm my touchpad works in the bios just fine, but hibernation (and sometimes suspend) make the touchpad glitchy. :frowning:
So close yet so far...

There are a number of ways you could do this. The easiest way (on Cinnamon) would be to add it to the "Startup Applications" applet. Just type "startup" in the launcher and it should come right up.

Click + and choose "custom command", then put the path of the binary or script in the "command" box.

Another way to accomplish this would be to set up a systemd service, which is more useful to be able to do but a lot more learning and reading to get started.

Too bad. You could check and see if a BIOS update has been released for your machine, more recent than this one:

Other than that, you might have to fall down the rabbit hole of searching for kernel modules that can improve your situation.

2 Likes

You can simply add the script to startup applications

ok, is this the proper format for the script? I put:

sudo go run ~/main.go

in the command box, but it doesn't seem to work. it works if i run it like that via the terminal, though.
btw, so far I really appreciate the help :smiley: i'll update my bios and see how it goes. worst case scenario i try to avoid hibernating the pc

Does it have to be run with sudo to work? Try running without sudo and see what happens. The other thing would be to take the "~" out (put the full path, like /home/nona/main.go

If it must be run with sudo, I'm afraid you'll have to set up a systemd service after all.

yup, has to be run with sudo :frowning: systemd I found a method using it, but I was unsure what to do, it needed me to get root permissions to add/remove files to the folder

To make a systemd service is not so bad. There is so much systemd documentation though, just getting started can be overwhelming. In this case, it is pretty simple.

First, make a script with the command you want to automatically run.

micro /usr/local/bin/go_for_it.sh

Add the command--no sudo, as it will be run by the system.

go run /home/nona/main.go

Save and exit, then make the script executable.

sudo chmod +x /usr/local/bin/go_for_it.sh

Next, test your script to make sure it works as intended. If it does not, it will save you a lot of grief to figure that out now rather than after you have set up the systemd service.

You can run the script by just writing out the path like this:

sudo /usr/local/bin/go_for_it.sh

Test before you have run the command already so you can see if it works!

If the script is all good, next make your unit file which will define your systemd service.

micro /etc/systemd/system/go_for_it.service

Something like this should be fine:

[Unit]
Description=My Excellent Go Touchpad Service

[Service]
Type=simple
ExecStart=/usr/local/bin/go_for_it.sh

[Install]
WantedBy=multi-user.target

Give it permissions:

sudo chmod 644 /etc/systemd/system/go_for_it.service

Start and enable the service:

sudo systemctl start go_for_it.service
sudo systemctl enable go_for_it.service

That's about it, reboot and test it out! :slightly_smiling_face:

6 Likes

Then you have to create a cronjob.

Install cronie using command

sudo pacman -Syu cronie

Then enter command

sudo EDITOR=xed crontab -e

Then just write the command, without sudo, in the xed window that opens up. In this case, enter

@reboot go run <absolute path>/main.go

( @reboot specifies that it must be run on each reboot )

Remember, you have to replace path with absolute path, else it might not work. To get absolute path, run pwd command in home directory and replace its output with ~

I hope this resolves your issue.

2 Likes

unfortunately the systemd method isn't working for me :frowning: it still won't boot on startup, i was able to make the files though, and the script itself works when i try running it. i will try the other method right now xD

Sounds good, the cron job will be easier to set up anyway and should work just as well.

You can troubleshoot a service with sudo systemctl status *name of service*. It is possible the target would need to be changed to start after graphical login for a Go script, I actually do not know. If the cron job doesn't work for some reason we can dig a little deeper.

cron job didn't work o_O, even if I wrote it as ~/main.go or /home/nona/main.go...

output of status gave me this:

Γ— driver.service - My Excellent Go Touchpad Service
     Loaded: loaded (/etc/systemd/system/driver.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Mon 2022-10-24 13:26:59 EDT; 28s ago
   Duration: 15ms
    Process: 840 ExecStart=/usr/local/bin/touchpad.sh (code=exited, status=203/EXEC)
   Main PID: 840 (code=exited, status=203/EXEC)
        CPU: 933us

Oct 24 13:26:59 nona-dynabookportegex50g systemd[1]: Started My Excellent Go Touchpad Service.
Oct 24 13:26:59 nona-dynabookportegex50g systemd[840]: driver.service: Failed to execute /usr/local/bin/touch>
Oct 24 13:26:59 nona-dynabookportegex50g systemd[840]: driver.service: Failed at step EXEC spawning /usr/loca>
Oct 24 13:26:59 nona-dynabookportegex50g systemd[1]: driver.service: Main process exited, code=exited, status>
Oct 24 13:26:59 nona-dynabookportegex50g systemd[1]: driver.service: Failed with result 'exit-code'.

i'm really grateful for your patience, I hope we can get this fixed soon :smiley:

Oct 24 13:26:59 nona-dynabookportegex50g systemd[840]: driver.service: Failed to execute /usr/local/bin/touch>
Oct 24 13:26:59 nona-dynabookportegex50g systemd[840]: driver.service: Failed at step EXEC spawning /usr/loca>

These two lines got cut off in your output above. Can you make the terminal bigger, or try to grab the rest of the line another way?

Another way to review this information would be sudo journalctl -u *name of service*.

1 Like

oh sry, here is what I get:


Oct 24 12:52:23 nona-dynabookportegex50g systemd[1]: /etc/systemd/system/driver.service:1: Assignment outside of section. Ignoring.
Oct 24 12:52:23 nona-dynabookportegex50g systemd[35491]: driver.service: Failed to locate executable /home/nona/drivers.sh: Permission denied
Oct 24 12:52:23 nona-dynabookportegex50g systemd[35491]: driver.service: Failed at step EXEC spawning /home/nona/drivers.sh: Permission denied
Oct 24 12:52:23 nona-dynabookportegex50g systemd[1]: Started driver.service.
Oct 24 12:52:23 nona-dynabookportegex50g systemd[1]: driver.service: Main process exited, code=exited, status=203/EXEC
Oct 24 12:52:23 nona-dynabookportegex50g systemd[1]: driver.service: Failed with result 'exit-code'.
Oct 24 12:52:47 nona-dynabookportegex50g systemd[1]: /etc/systemd/system/driver.service:1: Assignment outside of section. Ignoring.
Oct 24 12:52:47 nona-dynabookportegex50g systemd[1]: /etc/systemd/system/driver.service:1: Assignment outside of section. Ignoring.
-- Boot c619a5b1c2c94f239cab493efaa3b3a6 --
Oct 24 12:53:36 nona-dynabookportegex50g systemd[1]: Started driver.service.
Oct 24 12:53:36 nona-dynabookportegex50g systemd[808]: driver.service: Failed to locate executable /home/nona/drivers.sh: Permission denied
Oct 24 12:53:36 nona-dynabookportegex50g systemd[808]: driver.service: Failed at step EXEC spawning /home/nona/drivers.sh: Permission denied
Oct 24 12:53:36 nona-dynabookportegex50g systemd[1]: driver.service: Main process exited, code=exited, status=203/EXEC
Oct 24 12:53:36 nona-dynabookportegex50g systemd[1]: driver.service: Failed with result 'exit-code'.
Oct 24 12:54:25 nona-dynabookportegex50g systemd[1]: /etc/systemd/system/driver.service:1: Assignment outside of section. Ignoring.
Oct 24 12:56:17 nona-dynabookportegex50g systemd[9142]: driver.service: Failed to locate executable /home/nona/drivers.sh: Permission denied
Oct 24 12:56:17 nona-dynabookportegex50g systemd[9142]: driver.service: Failed at step EXEC spawning /home/nona/drivers.sh: Permission denied
Oct 24 12:56:17 nona-dynabookportegex50g systemd[1]: Started driver.service.
Oct 24 12:56:17 nona-dynabookportegex50g systemd[1]: driver.service: Main process exited, code=exited, status=203/EXEC
Oct 24 12:56:17 nona-dynabookportegex50g systemd[1]: driver.service: Failed with result 'exit-code'.
Oct 24 12:56:44 nona-dynabookportegex50g systemd[1]: /etc/systemd/system/driver.service:1: Assignment outside of section. Ignoring.
Oct 24 12:56:45 nona-dynabookportegex50g systemd[1]: /etc/systemd/system/driver.service:1: Assignment outside of section. Ignoring.
Oct 24 12:57:06 nona-dynabookportegex50g systemd[1]: /etc/systemd/system/driver.service:1: Assignment outside of section. Ignoring.
Oct 24 12:57:06 nona-dynabookportegex50g systemd[1]: /etc/systemd/system/driver.service:1: Assignment outside of section. Ignoring.
Oct 24 13:00:06 nona-dynabookportegex50g systemd[17236]: driver.service: Failed to locate executable /home/nona/drivers.sh: Permission denied
Oct 24 13:00:06 nona-dynabookportegex50g systemd[17236]: driver.service: Failed at step EXEC spawning /home/nona/drivers.sh: Permission denied
Oct 24 13:00:06 nona-dynabookportegex50g systemd[1]: Started driver.service.
Oct 24 13:00:06 nona-dynabookportegex50g systemd[1]: driver.service: Main process exited, code=exited, status=203/EXEC
Oct 24 13:00:06 nona-dynabookportegex50g systemd[1]: driver.service: Failed with result 'exit-code'.
Oct 24 13:00:34 nona-dynabookportegex50g systemd[18290]: driver.service: Failed to locate executable /home/nona/drivers.sh: Permission denied
Oct 24 13:00:34 nona-dynabookportegex50g systemd[18290]: driver.service: Failed at step EXEC spawning /home/nona/drivers.sh: Permission denied
Oct 24 13:00:34 nona-dynabookportegex50g systemd[1]: Started My Excellent Go Touchpad Service.
Oct 24 13:00:34 nona-dynabookportegex50g systemd[1]: driver.service: Main process exited, code=exited, status=203/EXEC
Oct 24 13:00:34 nona-dynabookportegex50g systemd[1]: driver.service: Failed with result 'exit-code'.
-- Boot d3caab5232bc445a92cb49cbace15bf3 --
Oct 24 13:02:07 nona-dynabookportegex50g systemd[1]: Started My Excellent Go Touchpad Service.
Oct 24 13:02:07 nona-dynabookportegex50g systemd[736]: driver.service: Failed to locate executable /home/nona/drivers.sh: Permission denied
Oct 24 13:02:07 nona-dynabookportegex50g systemd[736]: driver.service: Failed at step EXEC spawning /home/nona/drivers.sh: Permission denied
Oct 24 13:02:07 nona-dynabookportegex50g systemd[1]: driver.service: Main process exited, code=exited, status=203/EXEC
Oct 24 13:02:07 nona-dynabookportegex50g systemd[1]: driver.service: Failed with result 'exit-code'.
Oct 24 13:11:41 nona-dynabookportegex50g systemd[22763]: driver.service: Failed to locate executable /home/nona/drivers.sh: Permission denied
Oct 24 13:11:41 nona-dynabookportegex50g systemd[22763]: driver.service: Failed at step EXEC spawning /home/nona/drivers.sh: Permission denied
Oct 24 13:11:41 nona-dynabookportegex50g systemd[1]: Started My Excellent Go Touchpad Service.
Oct 24 13:11:41 nona-dynabookportegex50g systemd[1]: driver.service: Main process exited, code=exited, status=203/EXEC
Oct 24 13:11:41 nona-dynabookportegex50g systemd[1]: driver.service: Failed with result 'exit-code'.
Oct 24 13:12:01 nona-dynabookportegex50g systemd[23547]: driver.service: Failed to execute /usr/local/bin/touchpad.sh: Exec format error
Oct 24 13:12:01 nona-dynabookportegex50g systemd[23547]: driver.service: Failed at step EXEC spawning /usr/local/bin/touchpad.sh: Exec format error
Oct 24 13:12:01 nona-dynabookportegex50g systemd[1]: Started My Excellent Go Touchpad Service.
Oct 24 13:12:01 nona-dynabookportegex50g systemd[1]: driver.service: Main process exited, code=exited, status=203/EXEC
Oct 24 13:12:01 nona-dynabookportegex50g systemd[1]: driver.service: Failed with result 'exit-code'.
-- Boot 0d0ee46475ea4aa99bafd24c0d5c02af --
Oct 24 13:13:07 nona-dynabookportegex50g systemd[1]: Started My Excellent Go Touchpad Service.
Oct 24 13:13:07 nona-dynabookportegex50g systemd[722]: driver.service: Failed to execute /usr/local/bin/touchpad.sh: Exec format error
Oct 24 13:13:07 nona-dynabookportegex50g systemd[722]: driver.service: Failed at step EXEC spawning /usr/local/bin/touchpad.sh: Exec format error
Oct 24 13:13:08 nona-dynabookportegex50g systemd[1]: driver.service: Main process exited, code=exited, status=203/EXEC

i dont know if i can get any more lines, this is from journalctl btw

Okay, I think the fact that this is being stored in a user directory is causing a problem. The script and the binary may both need to be stored somewhere else, such as /usr/local/bin.

:point_up: What is drivers.sh, by the way? Did you make that script?

Try to set up a directory in /usr/local/bin and move all of the Go binaries/scripts out of your home directory and into the new directory.

sudo mkdir /usr/local/bin/go_go_gadget_touchpad
sudo mv /home/nona/*file you need to move* /usr/local/bin/go_go_gadget_touchpad/

Then edit the script (sudo micro /usr/local/bin/touchpad.sh) and make sure it is now pointing to the new path. Don't forget to run the script and make sure it works!

The systemd service should not need to be changed if it does not contain a reference to the home directory (it should just be calling the script in /usr/local/bin).

yes it was my own script. I tried changing everything to be in /usr/local/bin. I fixed the error, and my script runs again. I still dont get anything upon reboot though... :frowning:

Γ— driver.service - My Excellent Go Touchpad Service
     Loaded: loaded (/etc/systemd/system/driver.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Mon 2022-10-24 18:00:21 EDT; 1min 27s ago
   Duration: 11ms
    Process: 835 ExecStart=/usr/local/bin/touchpad/touchpad.sh (code=exited, status=203/EXEC)
   Main PID: 835 (code=exited, status=203/EXEC)
        CPU: 935us

Oct 24 18:00:21 nona-dynabookportegex50g systemd[1]: Started My Excellent Go Touchpad Service.
Oct 24 18:00:21 nona-dynabookportegex50g systemd[835]: driver.service: Failed to locate executable /usr/local/bin/touchpad/touchpad.sh: Permission denied
Oct 24 18:00:21 nona-dynabookportegex50g systemd[835]: driver.service: Failed at step EXEC spawning /usr/local/bin/touchpad/touchpad.sh: Permission denied
Oct 24 18:00:21 nona-dynabookportegex50g systemd[1]: driver.service: Main process exited, code=exited, status=203/EXEC
Oct 24 18:00:21 nona-dynabookportegex50g systemd[1]: driver.service: Failed with result 'exit-code'.
~

The plot thickens...

I have to admit, this brings me a little beyond my depth--I have no experience using Go. Hopefully someone will jump in if I dispense any bad advice. :smirk:

I read through this Digital Ocean tutorial and learned that instead of using go run foo.go (as you are doing), you can create a proper binary with go install. The binary should be able to be run from anywhere (as long as you add the Go install directory to your shell path) and will be better suited for running in startup programs or services.

First figure out where your GOPATH is:

go env GOPATH

It will probably say something like /home/nona/go. The go install command will place your new binary in $GOPATH/bin, so that is what you need to add to your shell path. Something like this:

set PATH /home/nona/go/bin $PATH

:point_up: Note the syntax is a little different for Fish than other shells; bear that in mind if you read through other documents and see guidance that looks different. (More on that here: Tutorial β€” fish-shell 3.5.1 documentation)

Navigate to the folder where your Go stuff is (your home folder I think) and run:

go install 

My understanding is that should add a binary to the $GOPATH/bin folder. The binary can be run without being inside the directory or specifying the path to the binary, because we added it to PATH.

If it is still called "main" as it was earlier in the thread, then you would just run

main

from the terminal.

If it works (:crossed_fingers:), confirm that you can run it without sudo--I think it should work. If no sudo is required, you can back up to this part of the thread:

Plop it right in the "Startup Applications" command box and see if it works.

5 Likes