/o.00

2012/7/30
https://www.esector.co.jp/

HULFT UNIX/Linux
1. HULFT UNIX/LinuxHULFT/># Set f_logch
f_logch(){# if the number of beams is 8(LF is contained.) or more figures -->#8 (LF)
long=`ls -l $HUL_LOG | awk '{print $5}'`
if [ `echo $long | wc -c` -ge 8 ]then# --> it backs up#mv -f $HUL_LOG $HUL_LOG.bak
touch -a $HUL_LOGfi}#!/bin/sh -x#"-x"# chkconfig: 345 95 05# description:HULFT_Host_to_Unix_File_Transfer####UNIX/Linux# chkconfig#RedHat chkconfig/##/etc/rc.d/init.d/# description#
RedHat chkconfig/#### JobName:HULFT starts & stops# FileName:hulftd# Creator:ESECTOR Ltd. http://www.esector.co.jp/# Set f_start# $1:command as huldaemon#HULFT# hulsndd
hulrcvd hulobsd# $2:option# HULFT
f_start(){# check hulft daemon still now# HULFT
ps -ef | grep -v grep | grep $1 > /dev/null 2>&1
if [ $? -ne 0 ]then# start hulft daemon# HULFT$1 $2 2>&1
# HULFT
RCD
RCD=$?
if [ $RCD -eq 0 ]then# write success#echo `date +%Y/%m/%d%t%T` `hostid` "$1 starts.($RCD)"else# write failed#echo `date +%Y/%m/%d%t%T` `hostid` "start of $1 failed.($RCD)"EFLG=2fielse# write "HULFT daemon(s) already started"#HULFTecho `date +%Y/%m/%d%t%T` `hostid` "$1 has already started."
EFLG=3fi}># Set f_env
f_env(){# Set HULFT Define Environment# HULFT
PATH=$PATH:/opt/hulft/bin:.
; export PATH
HULPATH=/opt/hulft/etc; export HULPATH
HULEXEP=/opt/hulft/bin; export HULEXEP# Set logfile PATH
#LOG_PATH=/var/hulft
HUL_LOG=$LOG_PATH/hul.log# Set LOCKFILE *RedHat only*# # RedHad# LOCK=/var/lock/subsys/hulftd# Set error flag#
EFLG=0}>

P 1/3© CEC Customer Service Ltd.

/o.002012/7/30
http:s//www.esector.co.jp/># Set f_stop# $1: command $2:huldaemon#HULFT# utlkillsnd utlkillrcv utlkillobs#HULFT# hulsndd hulrcvd hulobsd># Main#case "$1" instart)# HULFT daemon(s) starts.
#start# HULFT

f_stop(){# check HULFT daemon(s) still now#HULFTps -ef | grep -v grep | grep $2 > /dev/null 2>&1
if [ $? -eq 0 ]then# stop HULFT daemon(s)# HULFT$1 2>&1
RCD=$?
if [ $RCD -eq 0 ]then# write success#echo `date +%Y/%m/%d%t%T` `hostid` "$2 stops.($RCD)"else# write failed#echo `date +%Y/%m/%d%t%T` `hostid` "stop of $2 failed.($RCD)"EFLG=2fielse# write HULFT daemon(s) already stopped#HULFTecho `date +%Y/%m/%d%t%T` `hostid` "$2 has already stopped."
EFLG=3fi}

f_env
f_start hulobsd
f_start hulrcvd# -c ""# -d(sddreqls.dat)
f_start hulsndd "-c -d"# make LOCKFILE *RedHat only*# # HULFT
RedHat# touch $LOCK;;stop)# HULFT daemon(s) stops.
## HULFT

stop

f_env
f_stop utlkillobs hulobsd
f_stop utlkillrcv hulrcvd
f_stop utlkillsnd hulsndd# delete LOCKFILE *RedHat only*# # HULFT
RedHat# rm -f $LOCK;;# echo usage*)echo "Usage: $0 { start | stop }"EFLG=1;;esac# logfile rotation
f_logch()# exit at error flag
exit "$EFLG"
>

>

P 2/3

op r ht 2012t .

hts eser e/o.002012/7/30
https://www.esector.co.jp

/2.
HULFT

chown chgrp chmod

OSSolaris
AIX
HP-UXLinux(RHEL)/etc/init.d/hulftd/opt/HULFT/bin/hulftd/sbin/init.d/hulftd/etc/rc.d/init.d/hulftd(Solaris)# id
uid=0(root) gid=0(root)# cd /etc/init.d && pwd/etc/init.d# ls hulftd
hulftd# chown root hulftd && chgrp sys hulftd# chown 0744 hulftd# ls -al hulftd-rw-r--r-3 744
sysxxxx xx
xx
xx:xx hulftd※1# ln -s /etc/init.d/hulftd /etc/rc3.d/S99hulftd※1# ln -s /etc/init.d/hulftd /etc/rc2.d/K05hulftd# ls -al /etc/rc3.d/S99hulftd /etc/rc2.d/K05hulftd-rw-r--r-3 744sysxxxx xx
xx
xx:xx /etc/rc2.d/K05hulftd -> /etc/init.d/hulftd-rw-r--r-3 744
sysxxxx xx
xx
xx:xx /etc/rc3.d/S99hulftd -> /etc/init.d/hulftd

Solaris/AIX/etc/inittab/etc/rc.shutdown

mkitab "HULFT:2:wait:/opt/hulftd/bin/hulftd start"
rc.shutdown
if [ -x /opt/HULFT/bin/hulftd ]then/opt/hulftd/bin/hulftd stopfi/etc/rc.shutdown
OSrootHP-UX/sbin/rc1.d/K05hulftd/sbin/rc2.d/S99hulftd

※1 OS
※1 OS

HULFT
HULFT

((:/sbin/init.d/hulftd):/sbin/init.d/hulftd)((:/etc/rc.d/init.d/hulftd):/etc/rc.d/init.d/hulftd)

Linux(RHEL)/var/lock/subsys/hulftd/etc/rc.d/init.d/hulftd/etc/rc.d/rc0.d/K05hulftd/etc/rc.d/rc3.d/S99hulftd
※ S99

K05

HULFT

HULFT
HULFT
※1 OS
※1 OS

/
HULFT
HULFT

/P 3/3

op r ht 2012t .

hts eser e