Android support (aliendalvik.service) has stopped working

REPRODUCIBILITY (% or how often): 100%
BUILD ID = OS VERSION (Settings > About product): 4.3.0.12 (Suomenlinna)
HARDWARE (XA2, X10, X10 II, …): Xperia XA2 - Dual SIM
UI LANGUAGE: English
REGRESSION: (compared to previous public release: Yes, No, ?): ?

DESCRIPTION:

Android support no longer starts (it was working yesterday, I have updated nothing between it working and it stopping)

PRECONDITIONS:

None

STEPS TO REPRODUCE:

  1. Turn on phone

EXPECTED RESULT:

Android support starts (or can be started).

ACTUAL RESULT:

Android support cannot be started either from settings (start and stop both greyed out)
Also cannot be started by systemctl start aliendalvik.service

ADDITIONAL INFORMATION:

root@Sailfish nemo]# systemctl status -l aliendalvik
● aliendalvik.service - Alien Dalvik
   Loaded: loaded (/usr/lib/systemd/system/aliendalvik.service; disabled; vendor preset: enabled)
  Drop-In: /usr/lib/systemd/system/aliendalvik.service.d
           └─01-prevent-start.conf
   Active: failed (Result: exit-code) since Thu 2022-02-03 23:28:22 GMT; 7min ago
  Process: 29042 ExecStopPost=/usr/sbin/stop-aliendalvik.sh (code=exited, status=0/SUCCESS)
  Process: 29040 ExecStopPost=/usr/libexec/lxc/lxc-net stop (code=exited, status=0/SUCCESS)
  Process: 29018 ExecStartPost=/usr/sbin/alien-post-startup.sh (code=exited, status=20)
  Process: 28109 ExecStart=/usr/sbin/start-aliendalvik.sh (code=killed, signal=TERM)
  Process: 28104 ExecStartPre=/usr/libexec/lxc/lxc-net start (code=exited, status=0/SUCCESS)
  Process: 28100 ExecStartPre=/usr/sbin/start-aliendalvik-preinit.sh (code=exited, status=0/SUCCESS)
  Process: 28097 ExecStartPre=/usr/bin/start-aliendalvik-preinit.sh (code=exited, status=0/SUCCESS)
 Main PID: 28109 (code=killed, signal=TERM)

I have journal output of the timeperiod when the service is being started. A lot of it seems to be complaints about a read-only filesystem, I’ll try and add it in a followup comment.

Did some more digging.

If I start the aliendalvik container with:

systemctl start lxc@aliendalvik.service

Then check that it’s running:

[root@Sailfish nemo]# lxc-info -n aliendalvik
Name:           aliendalvik
State:          RUNNING
PID:            19266
IP:             192.168.0.213
IP:             2001:4d48:ad5c:ef00:3a78:62ff:fe3e:3de
IP:             fdb6:d7d8:c914:0:3a78:62ff:fe3e:3de
CPU use:        11.91 seconds
Memory use:     418.67 MiB
KMem use:       0 bytes

I can shell into it - so let’s do some digging. We know the alien-post-startup script is failing so let’s look at that, starting with the script contents:

[root@Sailfish nemo]# cat /usr/sbin/alien-post-startup.sh  | grep -vE '^#|^$'
lxc-attach -n aliendalvik -- /system/bin/sh -c "source /etc/mkshrc; settings put global device_provisioned 1"
lxc-attach -n aliendalvik -- /system/bin/sh -c "source /etc/mkshrc; settings put system accelerometer_rotation 1"

Now shelling in to the lxc container:

[root@Sailfish nemo]# lxc-attach -n aliendalvik -- /system/bin/sh
# source /etc/mkshrc 
:/ # settings put system accelerometer_rotation 1
cmd: Can't find service: settings

Ok, interesting. What can cmd find?

 :/ # cmd
 cmd: No service specified; use -l to list all services

20|:/ # cmd -l
Currently running services:
  alien.launcher
  android.security.keystore
  apexservice
  ashmem_device_service
  dnsresolver
  drm.drmManager
  gpu
  idmap
  incident
  installd
  media.audio_flinger
  media.drm
  media.extractor
  media.metrics
  media.player
  media.resource_manager
  netd
  stats
  storaged
  storaged_pri
  suspend_control
  vold

So no “settings” service.