Network-Startup Script

A forum for general AmigaOS 4.x support questions that are not platform-specific
K-L
Posts: 76
Joined: Thu Sep 08, 2011 9:35 pm
Location: Lyon, France
Contact:

Network-Startup Script

Post 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.
--
AmigaONE X1000 / Radeon 2400 Pro (R610LE) / AmigaOS 4.1 Final Edition
Samm440ep/733Mhs (o/c) / Radeon M9 / AmigaOS 4.1 Final Edition
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: Network-Startup Script

Post 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
+++++++++++++++++++++++
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1744
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: Network-Startup Script

Post 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
K-L
Posts: 76
Joined: Thu Sep 08, 2011 9:35 pm
Location: Lyon, France
Contact:

Re: Network-Startup Script

Post by K-L »

Interesting. I did not know I could add anything in this script.

Thanks for sharing :)
--
AmigaONE X1000 / Radeon 2400 Pro (R610LE) / AmigaOS 4.1 Final Edition
Samm440ep/733Mhs (o/c) / Radeon M9 / AmigaOS 4.1 Final Edition
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1744
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: Network-Startup Script

Post 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
User avatar
dan.hutch
Posts: 21
Joined: Tue Jun 28, 2011 9:50 pm

Re: Network-Startup Script

Post 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!
Raziel

Re: Network-Startup Script

Post 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
User avatar
cha05e90
Posts: 90
Joined: Fri Jun 17, 2011 11:15 pm
Location: Germany
Contact:

Re: Network-Startup Script

Post 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
X1000|II/G4|440ep|2000/060|2000/040|1000
User avatar
dan.hutch
Posts: 21
Joined: Tue Jun 28, 2011 9:50 pm

Re: Network-Startup Script

Post 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?
Raziel

Re: Network-Startup Script

Post 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?
Post Reply