Operating System - HP-UX
1832274 Members
2294 Online
110041 Solutions
New Discussion

Re: Automatic samba startup not starting at boot time, but starts manually

 
Automatic Samba startup
Occasional Advisor

Automatic samba startup not starting at boot time, but starts manually

Hi,

Before posting this message, I tried to figure out my issue reading lots of posts without finding the right answer.

I configured a samba automatic startup at boot time (link S91samba in rc2.d). Samba starts perfectly manually and runs pretty correct!

But, at boot time, /etc/rc.log tells me:

Start Samba Services
Output from "/sbin/rc2.d/S91samba start":
----------------------------
/sbin/rc2.d/S91samba[48]: 2818 Abandon(coredump)
/sbin/rc2.d/S91samba[53]: 2828 Abandon(coredump)

When I run the following manual command, samba runs immediatly

/sbin/rc2.d/S91samba start

Thanks in advance for your help

Attached:
16 REPLIES 16
Tim Nelson
Honored Contributor

Re: Automatic samba startup not starting at boot time, but starts manually

Hi Automatic Samba startup not starting at boot ,
welcome to the HPUX forums

perhaps try a higher start number, it is possible that some dependent service is not running yet ?

change S91 to S900

TTr
Honored Contributor

Re: Automatic samba startup not starting at boot time, but starts manually

How do you start it manually? Are you using the same startup script or are you using the commands smbd and nmbd typed in a shell. Or are you using the startsmb and stopsmb scripts provided by samba?

What OS version do you have?

@TimNelson: I think S91 runs quite late with the rest of the S9xx scripts. You were probably thinking of S091.
Automatic Samba startup
Occasional Advisor

Re: Automatic samba startup not starting at boot time, but starts manually

Hi Tim,

The link was in rc3.d as S900samba.

I'm using a link to /sbin/init.d/samba

The script is the following, running HP-UX B.11.11:

#! /usr/bin/sh

SUCCESS=0
FAILURE=1
exitval=$SUCCESS


KillProcess()
{
proc=$1
sig=$2

# Determine PID of process(es) to stop and kill it. This routine
# is designed to work with bourne shell, ksh and posix shell.

Command=`basename $proc | cut -c1-8` # Solaris ps limited to 8 chars.

pid=`ps -e | awk "\\$NF~/$Command/ {print \\$1}"`

if [ "X$pid" != "X" ]; then
kill -$sig $pid
fi
}

if [ ! -f /etc/rc.config.d/samba ]
then
echo "ERROR: Config file /etc/rc.config.d/samba missing."
exit $FAILURE
fi

. /etc/rc.config.d/samba

case $1 in
'start_msg')
echo "Start Samba Services"
;;

'stop_msg')
echo "Stop Samba Services"
;;

'start')
# Starting Samba is easy ...
if [ "$SAMBA_START" -eq 1 ]
then
if [ -x /usr/local/samba/bin/smbd ]
then
/usr/local/samba/bin/smbd -D
fi

if [ -x /usr/local/samba/bin/nmbd ]
then
/usr/local/samba/bin/nmbd -D
fi
fi
;;

'stop')
#
# ... stopping it, however, is another story
#
KillProcess nmbd TERM
KillProcess smbd TERM
;;

*)
echo "usage: $0 {start|stop|start_msg|stop_msg}"
exitval=$FAILURE
;;
esac

exit $exitval

To start it manually, as root, I launch:

/sbin/init.d/samba start

In the /etc/rc.config.d/samba, I have the following lines:

RUN_SAMBA=1
SAMBA_START=1
SAMBA_DEBUG=1

Thanks
Tim Nelson
Honored Contributor

Re: Automatic samba startup not starting at boot time, but starts manually

@TTR
nope. was really thinking S900.. my default samba install on 11.23 uses S900samba

network does not start until S340..
TTr
Honored Contributor

Re: Automatic samba startup not starting at boot time, but starts manually

> change S91 to S900

S91 runs at the end of the rc sequence and actually S91 runs after S900.
Automatic Samba startup
Occasional Advisor

Re: Automatic samba startup not starting at boot time, but starts manually

Hi All,

Initially, the link was S900samba on rc3.d. At this stage, the network was started successfully.

I moved S91samba from rc2.d to S999samba in rc3.d to ensure samba will start after all the others...

System restarting
Tim Nelson
Honored Contributor

Re: Automatic samba startup not starting at boot time, but starts manually

TTR is correct.. srry x2.. S91 does come after S900 alphabetically..

so in that case there should not have been any issue. hmmm


Automatic Samba startup
Occasional Advisor

Re: Automatic samba startup not starting at boot time, but starts manually

No more success.

Tried with S900samba, S999samba...
The network starts before any Sxxxsamba... but I still have the problem, with a core dump file.

Automatic Samba startup
Occasional Advisor

Re: Automatic samba startup not starting at boot time, but starts manually

Yes, that's the point.

I don't see where the problem could come from.

I've made another test: keeping S900samba and add S9samba. The 2nd one starts after all the others, with the same error (rc.log) as below:

Start Samba Services
Output from "/sbin/rc3.d/S900samba start":
----------------------------
/sbin/rc3.d/S900samba[48]: 3165 Abandon(coredump)
/sbin/rc3.d/S900samba[53]: 3170 Abandon(coredump)

Start CDE login server
Output from "/sbin/rc3.d/S990dtlogin.rc start":
----------------------------

Starting PRNGD (Pseudo Random Number Generator Daemon)
Output from "/sbin/rc3.d/S99prngd.rc start":
----------------------------
PRNGD (Pseudo Random Number Generator Daemon) started

Start Samba Services
Output from "/sbin/rc3.d/S9samba start":
----------------------------
/sbin/rc3.d/S9samba[48]: 3215 Abandon(coredump)
/sbin/rc3.d/S9samba[53]: 3249 Abandon(coredump)

**************************************************
HP-UX run-level transition completed
Tue Mar 16 17:37:26 2010
**************************************************

Desparating! :(

And the core dump file is not linked to this issue. I have no idea.
TTr
Honored Contributor

Re: Automatic samba startup not starting at boot time, but starts manually

Try puting the following line is the startup script before the startup commands
env > /tmp/env-samba.startup
and reboot the server.
Assumin that samba does not start up, after the server has booted, change the env line in the script to
env > /tmp/env-samba.shell
and run the startup script again from the shell.

Then compare the two environments and see if you need to set up some environment variables in the startup script.

Also with all these links that you have been creating and moving around, might you have another startup link somewhere and it messes everything up? Look in the /etc/rc.log file.

Also find the coredump file and run "file core" on it to see why it dumped.

Did samba ever startup successfully? What changes did you make recently, any OS patches or samba upgrades?
Automatic Samba startup
Occasional Advisor

Re: Automatic samba startup not starting at boot time, but starts manually

Hi TTR,

Well, at the automatic boot, the file was totally empty. Had a look at /etc/rc.log to check: the command env is unknown!
Automatic Samba startup
Occasional Advisor

Re: Automatic samba startup not starting at boot time, but starts manually

Sorry, I wasn't wakeup!

I added the full path to 'env' so that I got some result.

ENV from automatic startup:

SNMP_ATM_START=0
SENDMAIL_SERVER=0
LANG=fr_FR.iso88591
RBOOTD_DEVICES=
DDFA=0
SNMP_MASTER_START=0
MROUTED_ARGS=
XNTPD_ARGS=
PATH=/sbin
ROWS=23
XNTPD=1
SNMP_TRAPDEST_START=0
COLUMNS=80
INETD_ARGS=
MROUTED=0
SNMP_MIB2_START=0
ERASE=^H
INIT_STATE=3
COLS=79
RWHOD=0
SNMP_HPUNIX_START=0
PRE_U95=true
TERM=ITE_x80y24
PWD=/
TZ=WET0WETDST
LINES=24
SENDMAIL_SERVER_NAME=
NTPDATE_SERVER=0.0.0.0

ENV from manual startup:

MANPATH=/usr/share/man/%L:/usr/share/man:/usr/contrib/man/%L:/usr/contrib/man:/usr/local/man/%L:/usr/local/man:/opt/gr
aphics/PEX5/share/man:/opt/graphics/starbase/share/man:/opt/ldapux/share/man:/opt/ldapux/ypldapd/man:/opt/mx/share/man
/%L:/opt/mx/share/man:/opt/upgrade/share/man/%L:/opt/upgrade/share/man:/opt/resmon/share/man/%L:/opt/resmon/share/man:
/opt/graphics/common/man:/opt/pd/share/man/%L:/opt/pd/share/man:/opt/pd/share/man/%L:/opt/pd/share/man:/opt/pd/share/m
an/%L:/opt/pd/share/man:/opt/gnome/man:/opt/openssl/man:/opt/openssl/prngd/man:/opt/wbem/share/man:/opt/hparray/share/
man/%L:/opt/hparray/share/man:/opt/hatmmon/share/man:/usr/dt/share/man:/opt/graphics/phigs/share/man:/opt/OpenSource/m
an:/opt/videoout/share/man:/opt/ignite/share/man/%L:/opt/ignite/share/man:/opt/perl/man:/opt/iexpress/postgresql/man:/
opt/ssh/share/man:/opt/spb/share/man:/opt/gwlm/man/%L:/opt/gwlm/man:/usr/local/samba/man
LANG=fr_FR.utf8
SSH_TTY=/dev/pts/0
PATH=/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/fcms/bi
n:/opt/resmon/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/graphics/common/bin:/opt/pd/bin:/opt/gnome/bin:/opt/mozilla:/
opt/wbem/bin:/opt/wbem/sbin:/opt/netscape:/usr/local/bin:/opt/atok/bin:/opt/egb/bin:/opt/graphics/phigs/bin:/usr/sbin/
diag/contrib:/opt/OpenSource/bin:/opt/vje/bin:/opt/ignite/bin:/var/opt/netscape/servers/shared/bin:/var/opt/netscape/s
ervers/bin/slapd/server:/var/opt/netscape/servers/bin:/opt/hpsmh/bin:/opt/perl/bin:/opt/ssh/bin:/opt/java1.4/jre/bin:/
opt/spb/bin:/opt/mx/bin:/opt/gwlm/bin:/sbin:/home/root
COLUMNS=118
EDITOR=vi
LOGNAME=root
MAIL=/var/mail/root
SFTP_UMASK=
HOSTNAME=hpux
SFTP_LOG_FACILITY=2
ERASE=^H
SFTP_PERMIT_CHOWN=1
USER=root
SHLVL=1
SHELL=/sbin/sh
LOG_SFTP=0
HOSTTYPE=hppa2.0w
SFTP_LOG_LEVEL=3
OSTYPE=hpux11.00
HOME=/
SSH_CONNECTION=xx.xx.xx.xx XXXX xx.xx.xx.xx XX
TERM=xterm
PWD=/
MACHTYPE=hppa2.0w-hp-hpux11.00
TZ=WET0WETDST
SFTP_PERMIT_CHMOD=1
LINES=44

I'm seeing there's no HOSTNAME in the automatic ENV startup. Could it be the reason of the issue?
TTr
Honored Contributor

Re: Automatic samba startup not starting at boot time, but starts manually

HOSTNAME and several other variables are not standard variables, where do they get set and for what purpose? (maybe ~/.profile). Try it out, you got nothing to lose. Also the PATH is quite short at startup. The HP-UX samba script at 11.11 has
PATH=/sbin:/usr/sbin:/usr/bin:/opt/samba/bin
(in your case it would be /usr/local/samba/bin)
TTr
Honored Contributor

Re: Automatic samba startup not starting at boot time, but starts manually

Also try adding the debugging option in the startup script and check the log file for additional messages

/usr/local/samba/bin/smbd -D -d 10

The logfile location is specified in the config file.
Automatic Samba startup
Occasional Advisor

Re: Automatic samba startup not starting at boot time, but starts manually

Dear TTr,

Sorry, I was in travel.
Well, I'm coming back on tests...
Automatic Samba startup
Occasional Advisor

Re: Automatic samba startup not starting at boot time, but starts manually

Well,

I isolated the source of my problem.

The system boots with LANG=fr_FR.iso88591. But, when I login with any users, the LANG is set to LANG=fr_FR.utf8; which is fine to start manually samba.

Now I have only a few thing to adapt to fix it.

But the best would be to fix samba starting with LANG=fr_FR.iso88591.

If someone can help on this it will be great.

Thanks again
Jerome