Changeset 283 for branches/scripts


Ignore:
Timestamp:
Jun 24, 2009, 2:42:01 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

smb.cmd: Check if master.passwd exists, give hints in case of error

Location:
branches/scripts
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/scripts/group/groupmod.cmd

    r193 r283  
    11/* GroupMod script for Samba Server for eCS (OS/2) */
    2    Version = '2.1.3'
     2   Version = '2.2.0'
    33/* Copyright (C) netlabs.org 2007-2009
    44
     
    3737call _SambaInit
    3838
     39call _SambaExtendSearchPath
     40
    3941parse arg '-'mode' "'group'"'
    4042if group = "" & mode <> "" then parse arg '-'mode' 'group
     
    140142    script = VRParseFileName(script,'N')
    141143
     144    /* smbd.exe */
     145    samba.!smbd = ""
     146    if samba.!smbd = "" then do /* in current directory? */
     147        ok = SysFileTree('.\smbd.exe', exist.,'FO')
     148        if exist.0 = 1 then samba.!smbd = exist.1
     149    end
     150    if samba.!smbd = "" then do /* in parent directory? */
     151        ok = SysFileTree('..\smbd.exe', exist.,'FO')
     152        if exist.0 = 1 then samba.!smbd = exist.1
     153    end
     154    if samba.!smbd = "" then do /* in ..\BIN directory? */
     155        ok = SysFileTree('..\bin\smbd.exe', exist.,'FO')
     156        if exist.0 = 1 then samba.!smbd = exist.1
     157    end
     158    if samba.!smbd = "" then do /* in SMB_EXE ? */
     159        samba.!smbd = SysSearchPath("SMB_EXE","SMBD.EXE")
     160    end
     161    if samba.!smbd = "" then do /* in PATH ? */
     162        samba.!smbd = SysSearchPath("PATH","SMBD.EXE")
     163    end
     164
     165    samba.!bin = VRParseFileName(samba.!smbd,'DP')
     166    if samba.!bin = "" then samba.!bin = samba.!tools
     167
    142168    samba.!pwd_mkdb = SysSearchPath("PATH","pwd_mkdb.exe")
    143169    if samba.!pwd_mkdb = "" then do /* in current directory? */
     
    156182        samba.!pwd_mkdb = SysSearchPath("SMB_SBIN","pwd_mkdb.exe")
    157183    end
     184return
     185
     186_SambaExtendSearchPath:
     187    /* Add binary and tools path to the PATH variable */
     188    old_path = value('PATH',, 'OS2ENVIRONMENT')
     189    if pos(translate(samba.!bin';'),translate(old_path)) = 0 then do
     190        if samba.!bin = samba.!tools then new_path = samba.!bin';'
     191        else new_path = samba.!bin';'samba.!tools';'
     192        ok = value('PATH', new_path || old_path, 'OS2ENVIRONMENT')
     193        drop new_path
     194    end
     195    drop old_path
     196   
     197    /* Add binary and tools path to the BEGINLIBPATH variable */
     198    old_beginlibpath = SysQueryExtLibPath("B")
     199    if pos(translate(samba.!bin';'),translate(old_beginlibpath)) = 0 then do
     200        if samba.!bin = samba.!tools then new_beginlibpath = samba.!bin';'old_beginlibpath
     201        else new_beginlibpath = samba.!bin';'samba.!tools';'old_beginlibpath
     202        ok = SysSetExtLibPath( new_beginlibpath, "B")
     203        drop new_beginlibpath
     204    end
     205    drop old_beginlibpath
    158206return
    159207
  • branches/scripts/smb_init/readme.smb_init

    r251 r283  
    1 Samba Server for eCS (OS/2) init script Version 3.0.3
     1Samba Server for eCS (OS/2) init script Version 3.1.0
    22=====================================================
    33
     
    2626smb {start|stop|restart|reload|status|test}
    2727
    28 In addition a plugin feature found in IBM's TCPSTART.CMD is present in
    29 smb.cmd:
     28In addition a similar plugin feature found in IBM's TCPSTART.CMD is present
     29in smb.cmd:
    3030
    3131- If a file named B4SMB.CMD is found in the Samba directory, it will be run
     
    3535  after the Samba services have been stopped.
    3636
    37 smb.cmd is also used by SWAT and smbmon.exe to start or stop the Samba daemons
     37smb.cmd is also used by SWAT and smbmon.exe to start or stop the Samba daemons.
    3838
    3939In addition Samba daemons that refuse to stop peacefully are killed using
  • branches/scripts/smb_init/smb.cmd

    r268 r283  
    1 /* Samba Server for eCS (OS/2) init script Version 3.0.4
     1/* Samba Server for eCS (OS/2) init script Version 3.1.0
    22   Copyright (C) netlabs.org 2007-2009
    33
     
    6060            say 'Samba services are not running. Aborting...'
    6161            ok = directory(OldDir)
    62             exit -3
     62            exit -4
    6363        end
    6464        samba.!bin'\smbstatus.exe smbd 2>NUL'
     
    156156    end
    157157    UnixETC  = UnixRoot'\etc'
     158    /* Make sure it exists */
     159    ok = SysMkDir(UnixETC)
    158160
    159161    /* Find out various directories */
     
    198200    samba.!smbconf = stream(ETC'\samba\smb.conf','c','query exists')
    199201    if samba.!smbconf = "" then do
    200         say ETC'\samba\smb.conf is missing. Aborting...'
     202        say ETC'\samba\smb.conf is missing.'
     203        say 'Try running sscc.exe /install to create it! Aborting...'
    201204        exit -2
     205    end
     206
     207    /* Check if kLIBC password files exist */
     208    samba.!masterpasswd = stream(unixetc'\master.passwd','c','query exists')
     209    if samba.!masterpasswd = "" then do
     210        say unixetc'\master.passwd is missing.'
     211        say 'Try running sscc.exe /install to create it! Aborting...'
     212        exit -3
     213    end
     214
     215    samba.!pwddb = stream(unixetc'\pwd.db','c','query exists')
     216    if samba.!pwddb = "" then do
     217        say unixetc'\pwd.db is missing.'
     218        say 'Try running usermod to create it. Aborting...'
     219        exit -3
     220    end
     221
     222    samba.!spwddb = stream(unixetc'\spwd.db','c','query exists')
     223    if samba.!spwddb = "" then do
     224        say unixetc'\spwd.db is missing.'
     225        say 'Try running usermod to create it. Aborting...'
     226        exit -3
    202227    end
    203228
     
    257282    samba.!lock_dir   = translate(IniGet("lock directory", "global", samba.!smbconf),'\','/')
    258283    samba.!debuglevel = IniGet("log level", "global", samba.!smbconf)
     284
     285    /* make sure these directories exist */
     286    ok = SysMkDir(samba.!log_path)
     287    ok = SysMkDir(samba.!lock_dir)
    259288   
    260289    ok = value("SMB_LOGS",samba.!log_path,"OS2ENVIRONMENT")
  • branches/scripts/user/usermod.cmd

    r193 r283  
    11/* UserMod script for Samba Server for eCS (OS/2) */
    2    Version = '2.1.5'
     2   Version = '2.2.0'
    33/* Copyright (C) netlabs.org 2007-2009
    44
     
    3636call _SambaInit
    3737
     38call _SambaExtendSearchPath
     39
    3840parse arg '-'mode' "'User'"'
    3941if User = "" & mode <> "" then parse arg '-'mode' 'User
     
    163165    script = VRParseFileName(script,'N')
    164166
     167    /* smbd.exe */
     168    samba.!smbd = ""
     169    if samba.!smbd = "" then do /* in current directory? */
     170        ok = SysFileTree('.\smbd.exe', exist.,'FO')
     171        if exist.0 = 1 then samba.!smbd = exist.1
     172    end
     173    if samba.!smbd = "" then do /* in parent directory? */
     174        ok = SysFileTree('..\smbd.exe', exist.,'FO')
     175        if exist.0 = 1 then samba.!smbd = exist.1
     176    end
     177    if samba.!smbd = "" then do /* in ..\BIN directory? */
     178        ok = SysFileTree('..\bin\smbd.exe', exist.,'FO')
     179        if exist.0 = 1 then samba.!smbd = exist.1
     180    end
     181    if samba.!smbd = "" then do /* in SMB_EXE ? */
     182        samba.!smbd = SysSearchPath("SMB_EXE","SMBD.EXE")
     183    end
     184    if samba.!smbd = "" then do /* in PATH ? */
     185        samba.!smbd = SysSearchPath("PATH","SMBD.EXE")
     186    end
     187
     188    samba.!bin = VRParseFileName(samba.!smbd,'DP')
     189    if samba.!bin = "" then samba.!bin = samba.!tools
     190
    165191    samba.!pwd_mkdb = SysSearchPath("PATH","pwd_mkdb.exe")
    166192    if samba.!pwd_mkdb = "" then do /* in current directory? */
     
    179205        samba.!pwd_mkdb = SysSearchPath("SMB_SBIN","pwd_mkdb.exe")
    180206    end
     207return
     208
     209_SambaExtendSearchPath:
     210    /* Add binary and tools path to the PATH variable */
     211    old_path = value('PATH',, 'OS2ENVIRONMENT')
     212    if pos(translate(samba.!bin';'),translate(old_path)) = 0 then do
     213        if samba.!bin = samba.!tools then new_path = samba.!bin';'
     214        else new_path = samba.!bin';'samba.!tools';'
     215        ok = value('PATH', new_path || old_path, 'OS2ENVIRONMENT')
     216        drop new_path
     217    end
     218    drop old_path
     219   
     220    /* Add binary and tools path to the BEGINLIBPATH variable */
     221    old_beginlibpath = SysQueryEXtLibPath("B")
     222    if pos(translate(samba.!bin';'),translate(old_beginlibpath)) = 0 then do
     223        if samba.!bin = samba.!tools then new_beginlibpath = samba.!bin';'old_beginlibpath
     224        else new_beginlibpath = samba.!bin';'samba.!tools';'old_beginlibpath
     225        ok = SysSetExtLibPath( new_beginlibpath, "B")
     226        drop new_beginlibpath
     227    end
     228    drop old_beginlibpath
    181229return
    182230
Note: See TracChangeset for help on using the changeset viewer.