On Wed, Nov 21, 2007 at 03:08:57PM -0800, Brad Mitchell
wrote:
> Hi there,
>
> I hope this is indeed posted in the right area.
>
> In the past my company has produced an application
which runs as an appliance on Solaris 8 & 9. By running
as an appliance I mean, switch it on, switch it off. No FS
problems as the system is essentially running in read only.
The only means by which data is persisted is by using some
of the spare slices to store data. In our case, we had some
which contained config files and others which contained log
files. These files would get stored on a
"PRIMARY" and a "BACKUP" slice so even
if the system was turned off during a write operation, the
application would still be able to recover.
>
> Part of the project/application guidelines was to be
able to deploy in a rugged environment using as little
"moving-parts" hardware as possible. At the start
we used and still use the cPCI architecture and flash
memory. In the past it has been Sandisk Flash cards and
more recently, due to flash cards no longer working, PQi
flask 2.5" ide drives.
>
> Going from Solaris 2.6 -> Solaris 8 -> Solaris 9
didn't seem to be an issue in changing the rCS file and
mounting root as RO and remounting several parts of the OS
copied into /tmp (Memory) - var, etc, opt etc over existing
disk copies.
>
> The problem I am having now is that Solaris 10 has
changed significantly and SMF is here and causing me issues.
The issues come down to /etc. More importantly (I'm
guessing) is /etc/svc/*.
>
> I've had to change the time at which I copy the various
file system sub-directories to /tmp to be in the fs-root
method. This has worked for every sub-directory except for
etc. Mounting /etc at this stage completely halts the
system startup.
>
> Allowing the boot process to continue with /etc as RO
only causes bucket-loads of errors for various services.
>
> Is there any way to change the dependence on /etc, i.e.
change repository/where to point at for SMF related files or
is there a point in the start up sequence where /etc could
be safely replicated across to RW in memory so as the system
can start up?
You can run svc.configd and point it at an alternate
repository if you like:
usage: /lib/svc/bin/svc.configd [-np] [-d door_path] [-r
repository_path]
[-t nonpersist_repository]
My personal suggestion would be instead to hook into the
boot process prior
to SMF starting and mount (or remount) /etc/svc as
writeable. To do this,
construct /etc/inittab like this:
ap::sysinit:/sbin/autopush -f /etc/iu.ap
sp::sysinit:/sbin/soconfig -f /etc/sock2path
ps::sysinit:/lib/svc/bin/pre_smf >/dev/msglog
2<>/dev/msglog
smf::sysinit:/lib/svc/bin/svc.startd >/dev/msglog
2<>/dev/msglog </dev/console
and then fill in /lib/svc/bin/pre_smf as a shell script that
does whatever
you need done prior to SMF startup, which could be to make
/etc/svc writeable.
If you end up unmount or mounting on /etc/svc, keep in mind
that your script
will need to, prior to doing that:
umount /etc/svc/volatile
and then afterward:
[[ -d /etc/svc/volatile ]] || mkdir -m 0755
/etc/svc/volatile
mount -F tmpfs swap /etc/svc/volatile
to be sure that the SMF non-persistent database remains
rooted in tmpfs.
-Mike
--
Mike Shapiro, Solaris Kernel Development.
blogs.sun.com/mws/
_______________________________________________
appliances-discuss mailing list
appliances-discuss opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/appl
iances-discuss
|