[OmniOS-discuss] initialboot

PÁSZTOR György pasztor at sagv5.gyakg.u-szeged.hu
Mon Jul 31 23:01:01 UTC 2017


Hi,

"Al Slater" <al.slater at scluk.com> írta 2017-07-31 22:24-kor:
> I was thinking that if there was some way to "re-enable" initial-boot,
> then I could drop a /.initialboot script, re-enable initial-boot and
> then shutdown before creating new AMI, such that when an instance based
> upon the new AMI was launched, it would run .initialboot.
> 
> The problem is, enabling initial-boot immediately runs the .initialboot
> script and then disables itself.  So, I hoped there was a way to enable
> the service such that it did not immediately enable, but was enabled so
> it would start after the next reboot.

It's much cleaner now.

I saw sg. in svcadm's man, about marking a service temporarily... which is
in effect until the next reboot.
But, a much simpler solution what I tested:
I started my script with this:

trap 'rm /tmp/x' SIGINT
trap 'rm /tmp/x' SIGTERM

while [ -f /tmp/x ]; do
  sleep 5
done

And here follows your real script.


Before you'd enable again initial-boot, just touch /tmp/x

Maybe not the best workaround, but at least it works! ;)

Cheers,
Gyu


More information about the OmniOS-discuss mailing list