#14382: Package kit boot activation doesn't create users
-------------------------------+----------------------------
Reporter: kallisti5 | Owner: AGMS
Type: bug | Status: assigned
Priority: high | Milestone: R1/beta2
Component: Kits/Package Kit | Version: R1/Development
Resolution: | Keywords:
Blocked By: | Blocking:
Platform: All |
-------------------------------+----------------------------
Comment (by AGMS):
Discussion from the Beta2 meeting:
{{{
[2020-05-02 16:15] <nielx> Let's move on to https://dev.haiku-
os.org/ticket/14382? It's a high priority ticked about the user creation
[2020-05-02 16:16] <nielx> AGMS left a comment on it earlier
[2020-05-02 16:16] <AGMS> Package post-install adding users, etc. Been
busy reading code, mostly done. Got 3 choices for a solution: 1) quick
fix hack up the post install script to add users, 2) Add an API to do
post-install for all packages, call it in launch_daemon for first boot, 3)
Do it properly, make a list (file) of packages that need post-install
operations after reboot, magic keyword "all" for first boot.
[2020-05-02 16:16] *** dorje (~vision@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) has
joined the channel.
[2020-05-02 16:17] <PulkoMandy> I would say 2 is fine, 3 doesn't feel much
cleaner to me
[2020-05-02 16:17] <AGMS> Though 3 does fix a bug with packages that need
a reboot.
[2020-05-02 16:17] <nielx> I was just about to ask that question
[2020-05-02 16:17] <AGMS> Though that's not too many pakcages.
[2020-05-02 16:17] <nielx> I would imagine any Haiku package would require
a reboot
[2020-05-02 16:18] <nielx> (though they don't use post-installscripts
right now, do they)
[2020-05-02 16:18] <AGMS> The code looks for Haiku*.hpkg or something like
that. And there may be a flag you can set in the package too.
[2020-05-02 16:18] <AGMS> But other than the OpenSSL package which adds
users, this doesn't come up often.
[2020-05-02 16:19] <PulkoMandy> since the quick fix can be done quickly
(that's the point right) it can be pushed to the beta2 branch after
branching, if the other solution is not ready by then
[2020-05-02 16:19] <waddlesplash> in all honesty, it may be best to just
do the hack
[2020-05-02 16:19] <PulkoMandy> and we can hopefully have the real fix in
beta3 then
[2020-05-02 16:19] <waddlesplash> 3 shouldn't fix any bugs with reboots
[2020-05-02 16:19] <waddlesplash> users can be created without the package
being active
[2020-05-02 16:19] <nielx> waddlesplash: just short term or do you think
this will remainan edge case?
[2020-05-02 16:19] <waddlesplash> postinstall scripts can't
[2020-05-02 16:19] <waddlesplash> so this is only a problem with packages
initially installed needing it
[2020-05-02 16:20] <AGMS> Quick fix and document it?
[2020-05-02 16:20] *** HaikuUser
(~vision@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) has joined the channel.
[2020-05-02 16:21] <PulkoMandy> there's also the option of not shipping
sshd with the release, since it's the only affected package
[2020-05-02 16:21] <PulkoMandy> if people install it later on, it will
install properly
[2020-05-02 16:21] <nielx> Is it separate from the ssh client?
[2020-05-02 16:21] <waddlesplash> right
[2020-05-02 16:21] <PulkoMandy> is there a reason to ship sshd by default?
[2020-05-02 16:21] <waddlesplash> nielx: ah, I don't know
[2020-05-02 16:21] <waddlesplash> actually it may not be
[2020-05-02 16:21] <waddlesplash> so that's not great, indeed
[2020-05-02 16:22] <waddlesplash> adding the post-install script as a
"hack" seems best, for the release, then
[2020-05-02 16:22] <PulkoMandy> seems not, but we can split the package?
[2020-05-02 16:22] <waddlesplash> how does Linux/BSD/etc. do this?
[2020-05-02 16:22] <PulkoMandy> debian has an openssh_server package
[2020-05-02 16:22] <nielx> waddlesplash: packaging or creating users?
[2020-05-02 16:22] <PulkoMandy> of course you may want the client without
necessarily your machine being a server
[2020-05-02 16:22] <nielx> I am guessing for creating users it is during
the installation phase, executing post-installation scripts
[2020-05-02 16:22] <waddlesplash> ok, so then creating our own _server
subpackage sounds fine
[2020-05-02 16:23] <PulkoMandy> but the post-install script is maybe
easier as a temporary fix
[2020-05-02 16:23] <AGMS> Can the Network Prefences handle sshd not being
present?
[2020-05-02 16:23] <waddlesplash> no idea
[2020-05-02 16:23] <waddlesplash> but it should
[2020-05-02 16:24] *** HaikuUser has left the channel.
[2020-05-02 16:24] <PulkoMandy> ideally the network preferences add-on
would be shipped with the openssh_server package. Or at least I think that
was the idea for the add-ons based preferences panel
[2020-05-02 16:24] <AGMS> Or make the preferences a dependency?
[2020-05-02 16:25] <PulkoMandy> yes but that's micro-packaging things
[2020-05-02 16:25] <AGMS> Hmmm, uninstalled openssh and network prefs says
it is ON.
[2020-05-02 16:25] <nielx> It feels like this is a very specific
workaround for the really more general problem of do we support post-
install scripts (and user creation) for packages that require a reboot or
that are installed by default
[2020-05-02 16:25] <PulkoMandy> nielx: only the ones installed by default,
and there is only a single affected packages
[2020-05-02 16:26] <PulkoMandy> I think reboot is fine thanks to the
activated-packages file?
[2020-05-02 16:26] <AGMS> It also applies to future packages that need a
reboot.
[2020-05-02 16:26] <waddlesplash> no, it doesn't
[2020-05-02 16:26] <waddlesplash> those can have their users created
before the reboot
[2020-05-02 16:26] <AGMS> They don't get their post-install run. Though
the users would get created.
[2020-05-02 16:27] <AGMS> (user creation done as part of the transaction,
can roll it back too)
[2020-05-02 16:27] <AGMS> Also makes me wonder if packages mind if their
users are created after or before they start running.
[2020-05-02 16:27] <nielx> so my suggestion would be: for beta 2 let's do
it in a post-install script
[2020-05-02 16:28] <nielx> and move the ticket over to beta 3 for a proper
fix
[2020-05-02 16:28] <PulkoMandy> yes
[2020-05-02 16:28] <AGMS> Sounds good, option 1 quick fix and do the
better one later.
[2020-05-02 16:28] <nielx> I think the questions AGMS is asking are valid
[2020-05-02 16:28] <PulkoMandy> so the quickfix should be done in the
beta2 branch directly, and not in master
[2020-05-02 16:28] <nielx> and do need an answer, especially if we want to
support custom installs/images for R1
[2020-05-02 16:28] <AGMS> Oh, and can someone change the owner of the bug
to AGMS instead of agmsmith?
[2020-05-02 16:28] <nielx> will do
[2020-05-02 16:29] <PulkoMandy> done
[2020-05-02 16:29] <nielx> thanks AGMS
[2020-05-02 16:29] <nielx> Moving on to https://dev.haiku-
os.org/ticket/15808
}}}
--
Ticket URL: <https://dev.haiku-os.org/ticket/14382#comment:26>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.