弁財天

ゴフマン「専門家を信じるのではなく、自分自身で考えて判断せよ」

systemctl Running in chroot, ignoring request. update2

root@localhost:~# systemctl
Running in chroot, ignoring request.
root@localhost:~#

linuxdeployのgithub.com→How can I use "systemctl" to manage srevices in chroot? #846

Jerry981028 commented on 12 Sep
Systemd process needs to be Pid1 during device startup, which is nearly impossible on ordinary Android devices. You should try using sysvinit(service xxx start/stop)
「systemdプロセスは起動時にPID=1であることを要求するので、通常のAndroidデバイスではほぼ不可能。 なのでsysvinit(server xxx start/stop)を試すべき。」w

root@localhost:/etc/init.d# postmap /etc/aliases
postmap: warning: /etc/aliases, line 2: record is in "key: value" format; is this an alias file?
root@localhost:/etc/init.d# postalias /etc/aliases
root@localhost:/etc/init.d#
postmapじゃなくてpostaliasなのかw

root@localhost:~# apt update
略
Fetched 27.4 MB in 45s (608 kB/s)                                              
Reading package lists... Done
Building dependency tree       
Reading state information... Done
21 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@localhost:~#
root@localhost:~# apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  debian-archive-keyring gsettings-desktop-schemas iproute2 libaudit-common
  libaudit1 libcroco3 libhogweed4 libidn11 liblcms2-2 libllvm5.0 libnettle6
  libpam-systemd libpixman-1-0 libstartup-notification0 libsystemd0 libudev1
  systemd udev vim-common vim-tiny xxd
21 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.1 MB of archives.
After this operation, 194 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
略
Fetched 20.1 MB in 30s (659 kB/s)                                              
(Reading database ... 46402 files and directories currently installed.)
Preparing to unpack .../libpam-systemd_236-1_armhf.deb ...
Unpacking libpam-systemd:armhf (236-1) over (235-3) ...
Preparing to unpack .../libsystemd0_236-1_armhf.deb ...
Unpacking libsystemd0:armhf (236-1) over (235-3) ...
Setting up libsystemd0:armhf (236-1) ...
(Reading database ... 46402 files and directories currently installed.)
Preparing to unpack .../systemd_236-1_armhf.deb ...
mkdir: cannot create directory '/run/systemd': File exists
dpkg: error processing archive /var/cache/apt/archives/systemd_236-1_armhf.deb (--unpack):
 new systemd package pre-installation script subprocess returned error exit status 1
Preparing to unpack .../archives/udev_236-1_armhf.deb ...
Unpacking udev (236-1) over (235-3) ...
Preparing to unpack .../libudev1_236-1_armhf.deb ...
Unpacking libudev1:armhf (236-1) over (235-3) ...
Errors were encountered while processing:
 /var/cache/apt/archives/systemd_236-1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@localhost:~#
なにやらsystemdパッケージが原因になってupgradeに失敗。

apt-get clean とか apt-get autoclean あるけど、broken状態から抜けることはできないw。

mkdir: cannot create directory '/run/systemd': File exists
が原因?
消しちゃえw

root@localhost:~# mv /run/systemd /run/systemd.0

apt --fix-broken installを再実行w。

root@localhost:~# apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  systemd
Suggested packages:
  systemd-container
The following packages will be upgraded:
  systemd
1 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.
1 not fully installed or removed.
Need to get 0 B/2874 kB of archives.
After this operation, 178 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 46402 files and directories currently installed.)
Preparing to unpack .../systemd_236-1_armhf.deb ...
Unpacking systemd (236-1) over (235-3) ...
Setting up systemd (236-1) ...
Installing new version of config file /etc/systemd/timesyncd.conf ...
Processing triggers for man-db (2.7.6.1-4) ...
Processing triggers for dbus (1.12.2-1) ...
Setting up libpam-systemd:armhf (236-1) ...
root@localhost:~#
broken状態を脱出w。
なんなんだ、このできそこないなaptのパッケージ管理はw

もういちど実行すると、もうやることない旨のメッセージw。

root@localhost:~# apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.
root@localhost:~#

これでやっと apt upgrade できるのかw。

root@localhost:~# apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  debian-archive-keyring gsettings-desktop-schemas iproute2 libaudit-common
  libaudit1 libcroco3 libhogweed4 libidn11 liblcms2-2 libllvm5.0 libnettle6
  libpixman-1-0 libstartup-notification0 vim-common vim-tiny xxd
16 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.5 MB of archives.
After this operation, 49.2 kB disk space will be freed.
Do you want to continue? [Y/n] y
略
Fetched 15.5 MB in 26s (593 kB/s)                                              
(Reading database ... 46415 files and directories currently installed.)
Preparing to unpack .../debian-archive-keyring_2017.7_all.deb ...
Unpacking debian-archive-keyring (2017.7) over (2017.6) ...
Setting up debian-archive-keyring (2017.7) ...
(Reading database ... 46415 files and directories currently installed.)
Preparing to unpack .../libaudit-common_1%3a2.8.2-1_all.deb ...
Unpacking libaudit-common (1:2.8.2-1) over (1:2.8.1-2) ...
Setting up libaudit-common (1:2.8.2-1) ...
(Reading database ... 46415 files and directories currently installed.)
Preparing to unpack .../libaudit1_1%3a2.8.2-1_armhf.deb ...
Unpacking libaudit1:armhf (1:2.8.2-1) over (1:2.8.1-2) ...
Setting up libaudit1:armhf (1:2.8.2-1) ...
(Reading database ... 46415 files and directories currently installed.)
Preparing to unpack .../libnettle6_3.4-1_armhf.deb ...
Unpacking libnettle6:armhf (3.4-1) over (3.3-2) ...
Setting up libnettle6:armhf (3.4-1) ...
(Reading database ... 46417 files and directories currently installed.)
Preparing to unpack .../libhogweed4_3.4-1_armhf.deb ...
Unpacking libhogweed4:armhf (3.4-1) over (3.3-2) ...
Setting up libhogweed4:armhf (3.4-1) ...
(Reading database ... 46417 files and directories currently installed.)
Preparing to unpack .../00-iproute2_4.13.0-1_armhf.deb ...
Unpacking iproute2 (4.13.0-1) over (4.9.0-2.1) ...
Preparing to unpack .../01-xxd_2%3a8.0.1401-1_armhf.deb ...
Unpacking xxd (2:8.0.1401-1) over (2:8.0.1257-2) ...
Preparing to unpack .../02-vim-tiny_2%3a8.0.1401-1_armhf.deb ...
Unpacking vim-tiny (2:8.0.1401-1) over (2:8.0.1257-2) ...
Preparing to unpack .../03-vim-common_2%3a8.0.1401-1_all.deb ...
Unpacking vim-common (2:8.0.1401-1) over (2:8.0.1257-2) ...
Preparing to unpack .../04-libidn11_1.33-2.1_armhf.deb ...
Unpacking libidn11:armhf (1.33-2.1) over (1.33-2) ...
Preparing to unpack .../05-gsettings-desktop-schemas_3.24.1-2_all.deb ...
Unpacking gsettings-desktop-schemas (3.24.1-2) over (3.24.1-1) ...
Preparing to unpack .../06-libcroco3_0.6.12-2_armhf.deb ...
Unpacking libcroco3:armhf (0.6.12-2) over (0.6.12-1) ...
Preparing to unpack .../07-liblcms2-2_2.9-1_armhf.deb ...
Unpacking liblcms2-2:armhf (2.9-1) over (2.8-4) ...
Preparing to unpack .../08-libllvm5.0_1%3a5.0.1-1_armhf.deb ...
Unpacking libllvm5.0:armhf (1:5.0.1-1) over (1:5.0~+rc2-1) ...
Preparing to unpack .../09-libpixman-1-0_0.34.0-2_armhf.deb ...
Unpacking libpixman-1-0:armhf (0.34.0-2) over (0.34.0-1) ...
Preparing to unpack .../10-libstartup-notification0_0.12-5_armhf.deb ...
Unpacking libstartup-notification0:armhf (0.12-5) over (0.12-4+b2) ...
Processing triggers for mime-support (3.60) ...
Setting up gsettings-desktop-schemas (3.24.1-2) ...
Setting up xxd (2:8.0.1401-1) ...
Setting up liblcms2-2:armhf (2.9-1) ...
Processing triggers for libglib2.0-0:armhf (2.54.1-1) ...
Setting up libllvm5.0:armhf (1:5.0.1-1) ...
Setting up iproute2 (4.13.0-1) ...
Installing new version of config file /etc/iproute2/nl_protos ...
Installing new version of config file /etc/iproute2/rt_tables.d/README ...
Setting up libstartup-notification0:armhf (0.12-5) ...
Setting up libcroco3:armhf (0.6.12-2) ...
Setting up libpixman-1-0:armhf (0.34.0-2) ...
Processing triggers for libc-bin (2.25-3) ...
Setting up vim-common (2:8.0.1401-1) ...
Processing triggers for man-db (2.7.6.1-4) ...
Processing triggers for hicolor-icon-theme (0.17-1) ...
Setting up libidn11:armhf (1.33-2.1) ...
Setting up vim-tiny (2:8.0.1401-1) ...
Processing triggers for libc-bin (2.25-3) ...
root@localhost:~#
やっと apt upgrade に成功w

ASUS_Z01M_1:/ # losetup -a
/dev/loop2: [xxxx]:xxxx (/sdcard/linux.img)
/dev/loop1: [xxxx]:xxxx (/sdcard/linux.img)
/dev/loop0: [1031e]:13 (/data/magisk.img)
ASUS_Z01M_1:/ # 
同じ /sdcard/linux.img のループデバイスが複数できてるときは注意。
二重にマウントされてファイルシステムが壊れている可能性が大w。
/data/data/ru.meefik.linuxdeploy/bin/linuxdeploy umount するとか、
/data/data/ru.meefik.linuxdeploy/bin/linuxdeploy stop するとか、
スマホを再起動するなどして
/sdcard/linux.img のループバックデバイスが存在しない状態にして e2fsck をかけて修復する。
ASUS_Z01M_1:/ # e2fsck -fy /sdcard/linux.img                                   
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/sdcard/linux.img: 51759/131072 files (3.9% non-contiguous), 236135/524032 blocks
ASUS_Z01M_1:/ # 
ファイルシステムの耐久テストみたいなw。e2fsckが修復不可能になるほどに壊れることはないように思われw。

投稿されたコメント:

コメント
コメントは無効になっています。