Page 1 of 2

Network-Startup Script

Posted: Thu Aug 16, 2012 11:59 pm
by K-L
A new way of launching the network has appeared with Update 5.

This script is now included in Startup-Sequence :

If EXISTS S:Network-Startup
Run >NIL: <NIL: *>NIL: Execute S:Network-Startup
EndIf

Problem is it is situated just after the User-Startup launch script. And if you have commands using the Network in your User Startup, it will hang the system since the network has not been activated.

As I have 2 commands (one for activating my Samba shared hard drive and another one to set the time from a NTP server), the systems hangs at bootup.

Solution : in Startup-Sequence copy the command launching the network BEFORE the one launching the User-Startup. All is working ok now.

Re: Network-Startup Script

Posted: Fri Aug 17, 2012 12:39 am
by javierdlr
Have you tried to add such lines/commands in Network-Startup?


NETWORK-STARTUP file:
+++++++++++++++++++++++
; $VER: Network-Startup 53.2 (01.06.2011)

AddNetInterface QUIET DEVS:NetInterfaces/~(#?.info)

; Add below this line applications that need a running network
+++++++++++++++++++++++

Re: Network-Startup Script

Posted: Fri Aug 17, 2012 12:59 am
by nbache
K-L wrote:Solution : in Startup-Sequence copy the command launching the network BEFORE the one launching the User-Startup. All is working ok now.
I have to agree with javierdlr: This is not a good solution. Always, if at all possible, avoid completely changing your Startup-Sequence.

The idea of the Network-Startup script being launched asynchronously from the rest of the startup is that everything needing a running network should be placed in the Network-Startup, after it has brought up the network (as the comment in there says). That way it:

a) won't delay the rest of your system startup
b) won't fail because of a missing network

Best regards,

Niels

Re: Network-Startup Script

Posted: Fri Aug 17, 2012 3:11 am
by K-L
Interesting. I did not know I could add anything in this script.

Thanks for sharing :)

Re: Network-Startup Script

Posted: Fri Aug 17, 2012 11:18 pm
by nbache
K-L wrote:Interesting. I did not know I could add anything in this script.

Thanks for sharing :)
You're welcome ;-).

BTW, as you mentioned Samba: What I have done with Samba is that I set up my assign and path for Samba as the very first thing in the Network-Startup script instead of in User-Startup (to make sure it is done synchronously before using it later in the same script). Then comes the actual network start (AddNetInterface), which of course as part of what it does, sets up the Samba server(s) configured on the Servers page (and in Devs:Internet/servers). And even later in the script, I mount an SMB share (with SMBMounter), because at this time everything it needs (locally) should be available.

So always think in dependencies; if anything needs anything else, make sure it runs after the thing it needs. (Making sure means putting it in the same process, later on. Putting them in separate, partly parallel processes is gambling.)

Best regards,

Niels

Re: Network-Startup Script

Posted: Mon Nov 12, 2012 8:13 am
by dan.hutch
javierdlr wrote:Have you tried to add such lines/commands in Network-Startup?


NETWORK-STARTUP file:
+++++++++++++++++++++++
; $VER: Network-Startup 53.2 (01.06.2011)

AddNetInterface QUIET DEVS:NetInterfaces/~(#?.info)

; Add below this line applications that need a running network
+++++++++++++++++++++++
How do you correctly configure this? I started getting 'no netork/internet' errors with update 5, so I moved AmiUpdate, SimpleMail and Jabberwocky from WBStartup to the network startup. The problem is only the first program loads, no matter what order I put them in? Here's how it looks:

Code: Select all

NETWORK-STARTUP file:
+++++++++++++++++++++++
; $VER: Network-Startup 53.2 (01.06.2011)

AddNetInterface QUIET DEVS:NetInterfaces/~(#?.info)

; Add below this line applications that need a running network
+++++++++++++++++++++++

SYS:Utilities/AmiUpdate/AmiUpdate
APPLICATIONS:SimpleMail/SimpleMail
APPLICATIONS:Jabberwocky/Jabberwocky
The APPLICATIONS: assign is set in user startup. Any help or a working example appreciated, thanks!

Re: Network-Startup Script

Posted: Mon Nov 12, 2012 8:44 am
by Raziel
dan.hutch wrote: How do you correctly configure this? I started getting 'no netork/internet' errors with update 5, so I moved AmiUpdate, SimpleMail and Jabberwocky from WBStartup to the network startup. The problem is only the first program loads, no matter what order I put them in? Here's how it looks:

Code: Select all

NETWORK-STARTUP file:
+++++++++++++++++++++++
; $VER: Network-Startup 53.2 (01.06.2011)

AddNetInterface QUIET DEVS:NetInterfaces/~(#?.info)

; Add below this line applications that need a running network
+++++++++++++++++++++++

SYS:Utilities/AmiUpdate/AmiUpdate
APPLICATIONS:SimpleMail/SimpleMail
APPLICATIONS:Jabberwocky/Jabberwocky
The APPLICATIONS: assign is set in user startup. Any help or a working example appreciated, thanks!
The no network errors were probably due to a "run" before addnetinterface back then...your machine wasn't hooked to the net when programs kicked in to use it

This is my network-startup and it's not much

Code: Select all

; $VER: Network-Startup 53.2 (01.06.2011)

AddNetInterface DEVS:NetInterfaces/~(#?.info) QUIET

; Add below this line applications that need a running network

date server prefs save
I leave all the other application to WBStartup...because running it so early may lead to more problems because of not yet loaded dependencies

Re: Network-Startup Script

Posted: Mon Nov 12, 2012 9:15 am
by cha05e90
dan.hutch wrote: The problem is only the first program loads, no matter what order I put them in? Here's how it looks:

Code: Select all

NETWORK-STARTUP file:
+++++++++++++++++++++++
; $VER: Network-Startup 53.2 (01.06.2011)

AddNetInterface QUIET DEVS:NetInterfaces/~(#?.info)

; Add below this line applications that need a running network
+++++++++++++++++++++++

SYS:Utilities/AmiUpdate/AmiUpdate
APPLICATIONS:SimpleMail/SimpleMail
APPLICATIONS:Jabberwocky/Jabberwocky
Of course only AmiUpdate is started, because you don't detach it from your script. So nothing will happen, until you manually quit AmiUpdate (and Simplemail afterwards). It should read:

Code: Select all

Run >NIL: SYS:Utilities/AmiUpdate/AmiUpdate
Run >NIL: APPLICATIONS:SimpleMail/SimpleMail
Run >NIL: PPLICATIONS:Jabberwocky/Jabberwocky

Re: Network-Startup Script

Posted: Mon Nov 12, 2012 8:41 pm
by dan.hutch
@Raziel
I leave all the other application to WBStartup...because running it so early may lead to more problems because of not yet loaded dependencies
I've always done the same in the past but the network never seems to be ready soon enough for WBStartup now.

Code: Select all

date server prefs save
Take it this checks system time against the network time server specified in Time Prefs?

Re: Network-Startup Script

Posted: Mon Nov 12, 2012 10:23 pm
by Raziel
dan.hutch wrote:@Raziel
I leave all the other application to WBStartup...because running it so early may lead to more problems because of not yet loaded dependencies
I've always done the same in the past but the network never seems to be ready soon enough for WBStartup now.

Code: Select all

date server prefs save
Take it this checks system time against the network time server specified in Time Prefs?
Yes, it does.
It actually sets the time from the net (given there is net access) ;-) and saves it

I still get an assertion every time i boot from AddNetInterfaces...why is beyond me, probably because on the first start it can't access anything or doesn't get useable data back from the router.

Funny enough, because after the network has been established AmigaOS4 boots in and i can use the net...that puzzles me really
Maybe it isn't AddNetInterfaces but some other program kicking in from the kernel?