1

On the old good solaris 10, I used this script to create a totally automatized package for openssh(I prefer to update sshd by myself, personalize it, etc..) This script works fine on my homelan(can make some troubles and improved but works, of course test it at your own risk!). On Solaris 11 they use a totally new procedure with ips So I did those steps First create the necessary dirs

mkdir -p $HOME/user/openssh/{src,binary}

going into src dir

cd $HOME/openssh/src

download the latest openssh and check the gpg

wget https://ftp2.eu.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.4p1.tar.gz
wget https://ftp2.eu.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.4p1.tar.gz.asc
gpg -v *asc

then extract, configure, make.. and install in bindir

gtar -xvf *tar.gz
cd openssh-8.4p1
./configure --prefix=/opt/gm --sysconfdir=/etc/opt/gm/ssh --with-kerberos5=/usr --with-libedit=/usr --with-pam --with-solaris-contracts --with-solaris-projects --with-solaris-privs
gmake -j4
gmake install DESTDIR=$HOME/openssh/binary

then I start to create package for ips(i have already build a personal repository to install my packages).

pkg contents -r -m ssh > openssh.mog

I edit the mog file, remove all binaries and parts not needed(i will complete it later with the other commands), I also change some names(network/ssh become network/gmopenssh to avoid conflicts with ssh official package).

vim openssh.mog

then i generate the binaries list

pkgsend generate binary |pkgfmt > openssh.p5m.1

adding metadata...

pkgmogrify -DARCH=`uname -p` openssh.p5m.1 openssh.mog |pkgfmt > openssh.p5m.2

generation of deps..

pkgdepend generate -md binary openssh.p5m.2 |pkgfmt > openssh.p5m.3
pkgdepend resolve -m openssh.p5m.3

now we check if something is bad(permissions, owner,etc)

pkglint -c ./lint-cache -r http://pkg.oracle.com/solaris/release openssh.p5m.3.res

after some minutes correct the errors in openssh.p5m.3.res and redo pkglint

  vim openssh.p5m.3.res
  pkglint -c ./lint-cache -r http://pkg.oracle.com/solaris/release openssh.p5m.3.res

if no warning is returned finally we can upload the package, as I said first I have already a repository configured.

pkgsend publish -s http://localhost:9001 -d binary openssh.p5m.3.res

rebuild of repo..

pkgrepo rebuild -s http://localhost:9001

and finally install it

pkg install gmopenssh

Now, the question: on old Solaris 10 when I install the package, the checkinstall script import my manifest and method(of course added and modified in the right dirs even on Solaris 11 package). After install my package works fine, but I had to import the manifest and start the service..manually(sic!). How to substitute the good old checkinstall script in the ips configuration?

1 Answer 1

2

Solution found. My file openssh.p5m.3.res contain manifest in a bad position(non standard), so Solaris refuse to import it and activate.

Old config

dir  path=var/opt/gm/lib/svc/manifest owner=root group=sys mode=0755
dir  path=var/opt/gm/lib/svc/manifestnetwork owner=root group=sys mode=0755
file var/opt/gm/lib/svc/manifest/network/gmopenssh.xml \
    path=var/opt/gm/lib/svc/manifest/network/gmopenssh.xml owner=root group=sys \
    mode=0444 restart_fmri=svc:/system/manifest-import:default

new config

dir  path=lib/svc/manifest owner=root group=sys mode=0755
dir  path=lib/svc/manifest/network owner=root group=sys mode=0755
file lib/svc/manifest/network/gmopenssh.xml \
    path=lib/svc/manifest/network/gmopenssh.xml owner=root group=sys \
    mode=0444 restart_fmri=svc:/system/manifest-import:default

the line

restart_fmri=svc:/system/manifest-import:default

do the trick.

After upload again and do pkg update The service is created and active(fail only if sshd is not killed before install).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .