Artix Linux Forum

Init systems => S6 => Topic started by: lordrusk on 13 January 2020, 09:01:43

Title: Error when updating s6
Post by: lordrusk on 13 January 2020, 09:01:43
Just ran
Code: [Select]
sudo pacman -Syu
and saw s6-scripts and s6-rc had updates, but when it tries to update, I get
Code: [Select]
(1/1) Updating s6-rc database...
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 6: /usr/share/libalpm/scripts/s6-rc-db-update-hook: contents[0]=udevd: not found
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 6: /usr/share/libalpm/scripts/s6-rc-db-update-hook: contents[1]=agetty-tty2: not found
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 6: /usr/share/libalpm/scripts/s6-rc-db-update-hook: contents[2]=mount-cgroups: not found
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 6: /usr/share/libalpm/scripts/s6-rc-db-update-hook: contents[3]=hostname: not found
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 6: /usr/share/libalpm/scripts/s6-rc-db-update-hook: contents[4]=: not found
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 6: /usr/share/libalpm/scripts/s6-rc-db-update-hook: contents[5]=agetty-tty2: not found
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 6: /usr/share/libalpm/scripts/s6-rc-db-update-hook: contents[6]=agetty-tty2: not found
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 6: /usr/share/libalpm/scripts/s6-rc-db-update-hook: contents[7]=NetworkManager: not found
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 27: [: udev: unexpected operator
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 27: [: setup: unexpected operator
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 27: [: mount: unexpected operator
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 27: [: misc: unexpected operator
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 27: [: log: unexpected operator
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 27: [: getty: unexpected operator
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 27: [: boot: unexpected operator
/usr/share/libalpm/scripts/s6-rc-db-update-hook: 49: /usr/share/libalpm/scripts/s6-rc-db-u

When I try to update again, it says there is nothing to do. Should I be worried and not restart my machine?
Title: Re: Error when updating s6
Post by: Dudemanguy on 13 January 2020, 15:12:29
It looks like something went wrong with the update hook script. What happens if you run the script manually (sh /usr/share/libalpm/scripts/s6-rc-db-update-hook)? It doesn't look like any actual s6/s6-rc commands failed so you probably only lost your custom-made bundles.

Edit: It is worth noting that arrays aren't POSIX, but arch/artix links /usr/bin/sh to bash so I don't think it should matter (if it did you would have gotten errors before this anyway).
Title: Re: Error when updating s6
Post by: lordrusk on 13 January 2020, 23:34:42
alright, so yes the problem was bash vs sh. I link sh to dash for faster scripts. (every millisecond counts) which doesn't have bashisms, so I just ran the script manually through bash and it worked as expected. perhaps something to add the wiki for s6 as a warning or maybe find a way to run the script on update through bash instead of sh? Not sure how things like that work, so just an idea.
Title: Re: Error when updating s6
Post by: Dudemanguy on 14 January 2020, 01:17:36
I could just do the right thing and make it #!/bin/bash. s6-rc-0.5.1.1-10 here we come.
Title: Re: Error when updating s6
Post by: lordrusk on 14 January 2020, 05:35:00
Hey that works too :)
Title: Re: Error when updating s6
Post by: Dudemanguy on 14 January 2020, 21:03:09
It ended up being *-11 because of build screw ups on my part.  :P  It's in the system repo now.