Changeset 266 for branches/scripts
- Timestamp:
- Jun 13, 2009, 5:36:52 PM (16 years ago)
- Location:
- branches/scripts/smb_init
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/scripts/smb_init/b4smb.cmd
r193 r266 4 4 /* This script is executed before the Samba daemons are actually started 5 5 You may put arbitrary tasks in here. There are several task templates 6 in here here. Of these only the simple removal of previous logfiles is6 in here. Of these only the simple removal of previous logfiles is 7 7 enabled by default */ 8 8 … … 10 10 11 11 /* Remove previous logfiles only */ 12 say 'Remov eprevious logfiles'12 say 'Removing previous logfiles' 13 13 address cmd' del 'SMB_LOGS'\log.?mbd* 2>NUL' 14 14 address cmd' del 'SMB_LOGS'\log.winb* 2>NUL' -
branches/scripts/smb_init/smb.cmd
r251 r266 1 /* Samba Server for eCS (OS/2) init script Version 3.0. 21 /* Samba Server for eCS (OS/2) init script Version 3.0.3 2 2 Copyright (C) netlabs.org 2007-2009 3 3 … … 16 16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 17 18 Description: Starts and stops the Samba smbd and nmbd18 Description: Starts and stops the Samba smbd, nmbd and winbindd 19 19 daemons used to provide CIFS/SMB network services. 20 20 Run without parameter in order to display usage! … … 35 35 call directory samba.!bin 36 36 37 /* Check if winbindd daemon exists */38 HaveWinbindd = (stream(samba.!bin'\winbindd.exe', 'c', 'query exists') <> "")39 40 37 /* get the commandline arguments */ 41 38 arg UArg Service 42 39 43 /* Samba 3.3.x already supported!*/40 /* ALL is valid for Samba 3.3.x or better */ 44 41 if Service = "ALL" then Service = "" 42 43 /* Set delay to wait when daemons come up or shutdown */ 44 options.!delay = 1 /* sec */ 45 45 46 46 if \(Service = "") & \(Service = "SMBD") & \(Service = "NMBD") & \(Service = "WINBINDD") then do … … 201 201 exit -2 202 202 end 203 204 /* Check if winbindd daemon exists */ 205 HaveWinbindd = (stream(samba.!bin'\winbindd.exe', 'c', 'query exists') <> "") 203 206 return 204 207 … … 275 278 276 279 if running.!smbd = 1 & (svc = "SMBD" | svc = "") then do 277 'smbcontrolsmbd shutdown >' samba.!log_path'\log.smbd.shtdn 2>&1'278 ok = SysFileDelete(ETC'\samba\pid\smbd .pid')279 ok = SysSleep( 0.1)280 samba.!bin'\smbcontrol.exe smbd shutdown >' samba.!log_path'\log.smbd.shtdn 2>&1' 281 ok = SysFileDelete(ETC'\samba\pid\smbd*pid') 282 ok = SysSleep(options.!delay) 280 283 ok = _SambaRunning() 281 284 if words(pids.!smbd) > 0 then do I = 1 to words(pids.!smbd) 282 call charout ," Trying to killsmbd.exe PID "word(pids.!smbd,I)285 call charout ,"Killing smbd.exe PID "word(pids.!smbd,I) 283 286 ok = PRKillProcess("1", word(pids.!smbd,I)) 284 287 if ok = 0 then say ", success!"; else say ", error "ok … … 287 290 288 291 if running.!nmbd = 1 & (svc = "NMBD" | svc = "") then do 289 'smbcontrolnmbd shutdown >' samba.!log_path'\log.nmbd.shtdn 2>&1'290 ok = SysFileDelete(ETC'\samba\pid\nmbd .pid')291 ok = SysSleep( 0.1)292 samba.!bin'\smbcontrol.exe nmbd shutdown >' samba.!log_path'\log.nmbd.shtdn 2>&1' 293 ok = SysFileDelete(ETC'\samba\pid\nmbd*pid') 294 ok = SysSleep(options.!delay) 292 295 ok = _SambaRunning() 293 296 if words(pids.!nmbd) > 0 then do I = 1 to words(pids.!nmbd) 294 call charout ," Trying to kill nmbd.exe"word(pids.!nmbd,I)297 call charout ,"Killing nmbd.exe PID "word(pids.!nmbd,I) 295 298 ok = PRKillProcess("1", word(pids.!nmbd,I)) 296 299 if ok = 0 then say ", success!"; else say ", error "ok … … 299 302 300 303 if running.!winb = 1 & (svc = "WINBINDD" | svc = "") then do 301 'smbcontrolwinbindd shutdown >' samba.!log_path'\log.winbindd.shtdn 2>&1'302 ok = SysFileDelete(ETC'\samba\pid\winbindd .pid')303 ok = SysSleep( 0.1)304 samba.!bin'\smbcontrol.exe winbindd shutdown >' samba.!log_path'\log.winbindd.shtdn 2>&1' 305 ok = SysFileDelete(ETC'\samba\pid\winbindd*pid') 306 ok = SysSleep(options.!delay) 304 307 ok = _SambaRunning() 305 308 if words(pids.!winb) > 0 then do I = 1 to words(pids.!winb) 306 call charout ," Trying to kill winbindd"word(pids.!winb,I)309 call charout ,"Killing winbindd PID "word(pids.!winb,I) 307 310 ok = PRKillProcess("1", word(pids.!winb,I)) 308 311 if ok = 0 then say ", success!"; else say ", error "ok 309 312 end 310 313 end 311 ok = SysSleep( 0.2)314 ok = SysSleep(options.!delay) 312 315 if \_SambaRunning() then say Green||"Samba "samba.!version" services stopped successfully."||Normal 313 316 else do … … 367 370 if running.!smbd = 0 & (svc = "SMBD" | svc = "") then do 368 371 /* Just to be sure - this pid file should not be there anyway! */ 369 ok = SysFileDelete(ETC'\samba\pid\smbd .pid')372 ok = SysFileDelete(ETC'\samba\pid\smbd*pid') 370 373 ok = charout(, ' SMBD: ') 371 'detach smbd'374 'detach 'samba.!bin'\smbd' /* Do not add .exe here!!! */ 372 375 end 373 376 if running.!nmbd = 0 & (svc = "NMBD" | svc = "") then do 374 377 /* Just to be sure - this pid file should not be there anyway! */ 375 ok = SysFileDelete(ETC'\samba\pid\nmbd .pid')378 ok = SysFileDelete(ETC'\samba\pid\nmbd*pid') 376 379 ok = charout(, ' NMBD: ') 377 'detach nmbd -l 'samba.!log_path' -d 'samba.!debugLevel380 'detach 'samba.!bin'\nmbd -l 'samba.!log_path' -d 'samba.!debugLevel 378 381 end 379 382 if haveWinbindd & running.!winb = 0 & (svc = "WINBINDD" | svc = "") then do 380 383 /* Just to be sure - this pid file should not be there anyway! */ 381 ok = SysFileDelete(ETC'\samba\pid\winbindd .pid')384 ok = SysFileDelete(ETC'\samba\pid\winbindd*pid') 382 385 ok = charout(, ' WINBINDD: ') 383 'detach winbindd -l 'samba.!log_path' -d 'samba.!debugLevel384 end 385 ok = SysSleep( 0.3)386 'detach 'samba.!bin'\winbindd -l 'samba.!log_path' -d 'samba.!debugLevel 387 end 388 ok = SysSleep(options.!delay) 386 389 if svc = "" then do 387 390 if _SambaRunning("ALL") then say Green||"Samba "samba.!version" services started successfully."||Normal … … 453 456 return 0 454 457 455 IniGet: /* Replacement IniGet routine to access the value a known parameter */ 456 iparm = translate(arg(1),'_',' ') 458 IniGet: /* Replacement IniGet routine to access the value of a known 459 parameter */ 460 iparm = translate(arg(1),'_!',' :') 457 461 isection = arg(2) 458 462 /* Third parameter is ignored, as the file is not required here */ … … 461 465 /* Deal with empty/non existing parameters */ 462 466 if ivalue = translate(isection'.'iparm) then ivalue = '' 463 return ivalue 467 return ivalue
Note:
See TracChangeset
for help on using the changeset viewer.