0

I have an embedded system with an operating system built by yocto (Automotive Grade Linux: Halibut 8.0) that has 2 competing dhcp clients: connman and systemd-networkd.

sa8155:~# systemctl --type=service

  connman.service                                        loaded active running Connection service
  systemd-networkd.service                               loaded active running Network Service

I want to disable connman, but I get this strange error when I try:

sa8155:~# systemctl disable connman.service
Failed to disable unit: File /etc/systemd/system/multi-user.target.wants/connman.service: Read-only file system

I am root. So I'm not sure why it will not allow me to delete this file.

sa8155:~# ls -l /etc/systemd/system/multi-user.target.wants/connman.service
lrwxrwxrwx 1 root root 35 Nov 27  2019 /etc/systemd/system/multi-user.target.wants/connman.service -> /lib/systemd/system/connman.service
sa8155:~# 

Does anyone know why?
What would be the correct way to disable this service?

There seems to be an unusual number of file systems:

sa8155:~# df -hT
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/root     ext4    1.4G  504M  812M  39% /
devtmpfs  devtmpfs    291M     0  291M   0% /dev
tmpfs        tmpfs    443M     0  443M   0% /dev/shm
tmpfs        tmpfs    443M   18M  425M   4% /run
tmpfs        tmpfs    443M     0  443M   0% /sys/fs/cgroup
tmpfs        tmpfs    443M   18M  425M   4% /etc/machine-id
/dev/sde4     vfat    180M   53M  128M  30% /firmware
/dev/sde5     vfat     64M  512K   64M   1% /bluetooth
/dev/sde9     ext4     59M   21M   38M  36% /dsp
/dev/sda2     ext4    122M   12M  108M  10% /var
/dev/sda2     ext4    122M   12M  108M  10% /etc/bluetooth
/dev/sda2     ext4    122M   12M  108M  10% /persist
/dev/sda2     ext4    122M   12M  108M  10% /etc/build.prop
/dev/sda2     ext4    122M   12M  108M  10% /etc/usb
/dev/sda2     ext4    122M   12M  108M  10% /etc/misc/wifi
/dev/sda2     ext4    122M   12M  108M  10% /etc/smack/accesses.d
/dev/sda2     ext4    122M   12M  108M  10% /etc/adb_devid
tmpfs        tmpfs    443M  416K  442M   1% /var/volatile
tmpfs        tmpfs    443M  416K  442M   1% /persist/volatile
/dev/sda8     ext4    108G  6.4G  101G   6% /data
/dev/sda8     ext4    108G  6.4G  101G   6% /home
tmpfs        tmpfs    755M  4.0K  755M   1% /run/user/0
/dev/sda8     ext4    108G  6.4G  101G   6% /home/root/adas/dev
/dev/sda8     ext4    108G  6.4G  101G   6% /data/root/adas/dev
sa8155:~# 
3
  • 2
    Is the / filesystem mounted as readonly? This was the case on a linux image for an embedded system I was working with. The temporary (until next boot, because the change wasn't propagated to the persistent storage) solution was to remount the filesystem rw, make the change, remount ro
    – einfeyn496
    Aug 7 '20 at 21:07
  • yes. that was indeed the case. thank you.
    – Alex Ryan
    Aug 7 '20 at 22:51
  • @einfeyn496 You should make that an answer. Aug 8 '20 at 0:05
1

Sometimes on embedded systems the / filesystem is mounted readonly, usually because it's on a storage type that degrades with many writes, and longevity is a priority.

A temporary solution to this particular issue is to remount the filesystem as rw, make the necessary change, and then remount again to `ro. This will likely only be temporary because the change probably hasn't been made to the persistent storage.

Sometimes, the image will come with a way to make the changes persistent, e.g., by writing to a configuration file in the persistent storage that gets read during boot (in your case, the first place I would look would be in /persist, but also in the documentation of the image, if there is some).

If this is truly an incompatible set of services, the proper solution is probably to fix the underlying image by only enabling the services that are needed, and then reflashing your device.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.