Forum archive
How to set application specific values ?
I have been trying to find out how application specific values can be gathered during the first boot and then later used to configure the application.
I guess this is done with inithooks: /docs/inithooks but I fail to see how the magic happens.
E.g. I have been checking jenkins. In overlay/usr/lib/inithooks/firstboot.d/40jenkins
#!/bin/bash -e # set jenkins admin password . /etc/default/inithooks [ -e $INITHOOKS_CONF ] && . $INITHOOKS_CONF $INITHOOKS_PATH/bin/setpass.py admin --pass="$APP_PASS"
Here the APP_PASS variable has got the value somehow automatically ? The setpass.py script is part of TKLCore as it's not found from jenkins repository ? How TKLCore knows how to configure jenkins ? Obviously I have to set my application specific settings myself ? How the inithooks knows what settings I want to ask from the user ?
I can't speak for Jenkins, but the point of having them as variables is so that they can be preseeded (e.g. by the values entered in the TKL Hub pre-launch WebUI). If the variables have no value then the firstboot scripts will ask...
TBH I just had a look and you appear to be right (in the fact that setpass.py doesn't seem to be a part of Jenkins itself) so as you suggest perhaps it's a part of Core (although TBH I wouldn't think that Core would need it...). Unfortunately I (still) haven't had time to play with TKLDev yet and so can't help much in that regard, but it must be somewhere and I suspect that you may be able to leverage that same script for your own password creation...
inithooks will just run each script in ../firstboot.d (in order). And as I said above, if a value hasn't already been fed in (via preseeding) then it will ask... Different appliances will have different firstboot scripts...