# px4 service issue

Source: https://forum.modalai.com/topic/4010/px4-service-issue
Category: VOXL SDK and Software (https://forum.modalai.com/category/47/voxl-sdk-and-software)
Tags: voxl-sdk
Posted: 2024-12-11 14:31:38 UTC by giladWDS
Replies: 8 · Views: 1565

## giladWDS · 2024-12-11 14:31:38 UTC

I have an issue with the px4 service where the px4 service starts at stop status on the drone boot. In my short time debugging this I looked at the body of the service and I see it requires another service to end:
```
[Unit]
Description=px4
After=sscrpcd.service
Requires=sscrpcd.service

[Service]
ExecStartPre=/bin/sleep 2
ExecStart=/usr/bin/voxl-px4
Restart=on-failure

[Install]
WantedBy=multi-user.target
```
but I can't find this service on the system nor can I find it online.
Am I missing something? 
I would love some help with this.

## Reply by Eric Katzfey (ModalAI staff) · 2024-12-11 15:52:55 UTC

@giladWDS I'm not sure I understand what you mean by "starts at stop status". Can you explain the issue? And what service can't you find? sscrpcd.service?
```
voxl2:/$ sudo find . -name sscrpcd.service
./lib/systemd/system/multi-user.target.wants/sscrpcd.service
./lib/systemd/system/sscrpcd.service
find: './sys/kernel/slab': Input/output error
./sys/fs/cgroup/pids/system.slice/sscrpcd.service
./sys/fs/cgroup/devices/system.slice/sscrpcd.service
./sys/fs/cgroup/systemd/system.slice/sscrpcd.service
./sys/fs/cgroup/unified/system.slice/sscrpcd.service
```

## Reply by giladWDS · 2024-12-12 21:18:20 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 
never  knew that there are services outside of `/etc/systemd/system`
and ` systemctl status voxl-px4` gives disable. I will bring the full argument  as soon as I have access to the machine

## Reply by Eric Katzfey (ModalAI staff) · 2024-12-13 16:12:47 UTC (in reply to giladWDS)

@giladWDS To enable it just enter `systemctl enable voxl-px4`

## Reply by giladWDS · 2024-12-15 07:57:44 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 
I did. The issue is that the drone is supposed to be autonomous at the end. and I would like to avoid constantly checking whether the px4 service is alive or not.
from my understanding the service is supposed to be alive on boot so it seems to be a bag that I would want to fix.

## Reply by Eric Katzfey (ModalAI staff) · 2024-12-15 16:49:26 UTC (in reply to giladWDS)

@giladWDS Okay, so the issue is that the service starts but px4 is not actually running? Can you include the output of the command `systemctl status -l voxl-px4`? And also `journalctl -b -u voxl-px4`?

## Reply by ben grocholsky · 2024-12-31 05:14:47 UTC (in reply to Eric Katzfey)

@Eric-Katzfey I saw a similar symptom last Friday on a voxl2 that seemed to have a corrupt partition for `/dev/sda8`. 
Flashing to 1.3.5 wrote `/data` to `/` without sda8 mounted.
`voxl-px4` failed depending on `sscrpcd.service` which failed depending on `data.mount`

`voxl2:/$ mount /dev/disk/by-partlabel/userdata /data` 
mount: /data: wrong fs type, bad option, bad superblock on /dev/sda8, missing codepage or helper program, or other error.

`voxl2:/$ fsck.ext4 /dev/sda8`           
e2fsck 1.44.3 (10-July-2018) 
ext2fs_open2: Bad magic number in super-block 
fsck.ext4: Superblock invalid, trying backup blocks... 
fsck.ext4: Bad magic number in super-block while trying to open /dev/sda8

`voxl2:/$ fdisk -l |grep sda8` 
The backup GPT table is corrupt, but the primary appears OK, so that will be used. 
/dev/sda8     41480 16818695 16777216   64G unknown

Reflashing with `./install.sh --wipe-persistent` fixed `sda8` and made everything work. 

@giladWDS could be worth checking `/dev/sda8` is being mounted as `/data` without any errors.

## Reply by tom (ModalAI staff) · 2024-12-31 18:50:47 UTC (in reply to ben grocholsky)

@ben-grocholsky This is very interesting, not something I've seen before. Out of curiosity what OS on your host machine are you using for the flashing process?

## Reply by ben grocholsky · 2025-01-03 00:29:21 UTC (in reply to tom)

@tom that was from ubuntu 20.04. Looking back up the terminal history I see the install script stopped at:
`[ERROR] missing /data/modalai/sku.txt`
`[ERROR] please run voxl-configure-sku to make a new one`
and didn't run the next setup steps. I didn't realize the flashing failed until seeing `voxl-px4` couldn't start. And digging into that found this thread.
