List Info

Thread: Re: Solaris as an applicance - Read-only FS &




Re: Solaris as an applicance - Read-only FS &
country flaguser name
United States
2007-11-27 00:30:14
> 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]
> 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-discussopensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/appliance

> s-discuss

I've changed the inittab and done this and to an extent,
this has worked well.

At the moment I have:
/ is read only and I've commented out the section in fs-usr
to remount the root file system.

I made a copy of etc, opt, platform, sbin, usr, var under a
directory off the root file system called /memRoot.

I do the following in this start up script:
1) Mount /tmp
mount -F tmpfs swap /tmp

2) copy all files from /memroot/root
( cd /memRoot/root; find . -print -depth | cpio -pdm
/tmp/root )

3) Mount existing file systems
mount -m -F lofs /tmp/root/etc /etc
mount -m -F lofs /tmp/root/usr /usr
mount -m -F lofs /tmp/root/sbin /sbin

4) Copy devices and dev
cd /
find devices dev -depth -print | cpio -pdm /tmp

5) Mount devices and dev
mount -m -F lofs /tmp/devices /devices
mount -m -F lofs /tmp/dev /dev

mount -F tmpfs swap /tmp/var/run

-------

All the services are running and starting.  Some of these
have been disabled.  Ones which are not really required for
a locked down and cut down system.  There is one problem and
that is the console-login service is not coming up.  In
fact, its not even executing.  For some reason it just sits
there locked up.  This is different of course if root is
mounted read-write.
 
 
This message posted from opensolaris.org
_______________________________________________
appliances-discuss mailing list
appliances-discussopensolaris.org
http://mail.opensolaris.org/mailman/listinfo/appl
iances-discuss

Re: Solaris as an applicance - Read-only FS &
country flaguser name
United States
2007-12-27 13:53:09
Did you ever find an answer to your problem where the
console-login service wasn't working?
 
 
This message posted from opensolaris.org
_______________________________________________
appliances-discuss mailing list
appliances-discussopensolaris.org
http://mail.opensolaris.org/mailman/listinfo/appl
iances-discuss

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )