LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-30-2024, 03:51 PM   #16
inukaze
Member
 
Registered: Feb 2011
Location: Venezuela - Caracas
Distribution: Slackware64 14.2, Slackware 14.2, Gentoo, Devuan, gNewSense, GoboLinux, Leeenux, Porteus
Posts: 290

Original Poster
Rep: Reputation: 26

Quote:
Originally Posted by michaelk View Post
What type of ISP? Do you use a VPN service? When you run the script manually the network is up and the script works fine?

Basically if ntpdate is installed it will located in /usr/sbin so whereis is not necessary.
ISP, National for Public Administration.
No we not use VPN service.
yes when i ran the script manually works fine
 
Old 01-30-2024, 04:10 PM   #17
metaed
Member
 
Registered: Apr 2022
Location: US
Distribution: Slackware64 15.0
Posts: 374

Rep: Reputation: 172Reputation: 172
Do you have anything in /etc/rc.d/rc.inet1.conf?
 
Old 01-30-2024, 04:20 PM   #18
Windu
Member
 
Registered: Aug 2021
Distribution: Arch Linux, Debian, Slackware
Posts: 597

Rep: Reputation: Disabled
Quote:
Originally Posted by inukaze View Post
in the script the right path is solve by this command
Code:
ntpdate=$(whereis -B "/usr/sbin" "/usr/local/sbin" "/sbin" "/usr/bin" "/usr/local/bin" "/bin" -b ntpdate | grep -i "ntpdate" | cut -d " " -f02 | cut -c11-20)
Did you actually verify that? To me it looks like you copy/pasted a lot of code from the internet without understanding what it is supposed to do.

Try running that command
Code:
whereis -B "/usr/sbin" "/usr/local/sbin" "/sbin" "/usr/bin" "/usr/local/bin" "/bin" -b ntpdate | grep -i "ntpdate" | cut -d " " -f02 | cut -c11-20
- it just returns the string "ntpdate", there's no full path.
Use
Code:
which ntpdate
instead, much cleaner.
 
Old 01-30-2024, 04:58 PM   #19
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
Quote:
In "ping" during boot the network access is not ready at that point
Do you know the reason why not? Is this a mobile data plan of some type?
 
Old 01-30-2024, 05:14 PM   #20
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,474
Blog Entries: 7

Rep: Reputation: 2573Reputation: 2573Reputation: 2573Reputation: 2573Reputation: 2573Reputation: 2573Reputation: 2573Reputation: 2573Reputation: 2573Reputation: 2573Reputation: 2573
Dissecting what you're trying to do. Please correct me if I'm misunderstanding your goals here.

The first part of the script tests for internet access before syncing with NTP. Why don't you just use NTP as it was designed? It is trivial to set this up in Slackware. There are two steps:
1. Edit /etc/ntp.conf to remove the hashes (# comment marks) from the beginning of lines 19-22.
2. chmod +x /etc/rc.d/rc.ntpd

This will start the NTP daemon which will sit in the background and wait for a network connection before trying to synchronise your clock. I don't understand why you seem to think you need to complicate it so much?

The second part of the script tests if a remote machine is up and then mounts the CIFS shares from that remote machine. Again, this looks far more complicated than it needs to be. I'd second the notion that you may want to set up AutoFS for this instead.

The third part of the script starts QEMU, and is the only part of your script I'd leave in there:

Quote:
Originally Posted by inukaze View Post
Code:
if [ -x /etc/rc.d/rc.qemu-ga ]; then
  # Start QEMU Guest Agent:
  echo "Starting QEMU Guest Agent:    /etc/rc.d/rc.qemu-ga start"
  /etc/rc.d/rc.qemu-ga start
fi
Quote:
Originally Posted by inukaze View Post
With NetworkManager, i need configure the Cisco Switch to use the MAC to get a static ip exclusive for my pc, because the internal DHCP server every time i restart, change the ip.
NetworkManager is somewhat less than ideal for a machine you intend to use as a server. It shines on laptops, netbooks and other devices which are commonly and constantly changing (usually wifi) networks. The problem with NetworkManager, as pointed out above, is that you have to wait for a user to log in to connect to a network... which is pretty useless for a machine you're wanting to use as a server.

To me, it seems like this a machine which should be configured to use a static IP. You can do this using the netconfig script, choosing static IP and following the bouncing ball.

Last edited by rkelsen; 01-30-2024 at 05:16 PM.
 
1 members found this post helpful.
Old 01-31-2024, 12:51 AM   #21
henca
Senior Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 1,013

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
Quote:
Originally Posted by inukaze View Post
With NetworkManager, i need configure the Cisco Switch to use the MAC to get a static ip exclusive for my pc, because the internal DHCP server every time i restart, change the ip.

I make a internal NTP server with ip 10.48.1.38
Why not simply configure a static IP address in the 10.*-series in your internal network for your computer? Or, if you want to use dhcp, couldn't you use rc.inet1.conf to configure your eth0 to get its address from dhcp? You might need to configure your internal dhcp server to reserve some addresses for static ip addresses unless you want dhcp for all your machines.

I haven't used NetworkManager myself, but isn't it possible to configure NetworkManager to initialize your network at boot instead of waiting for a logged in user to configure the network?

regards Henrik
 
Old 01-31-2024, 06:36 AM   #22
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 528

Rep: Reputation: 272Reputation: 272Reputation: 272
Quote:
Originally Posted by inukaze View Post
In "ping" during boot the network access is not ready at that point
What I do, in similar situations, is wait for ping to succeed within 10 seconds and if it does, execute code

Code:
timeout 10 bash -c "until ping -c1 192.168.1.100 &>/dev/null; do :; done" && echo "OK" || echo "NOK"
Replace the echo "OK" for your code and the echo "NOK" for an appropriate error message.

Don't worry about adjusting the timeout 10 to something larger like 30 seconds or several minutes, as the script proceeds as soon as ping gets through, not at the end of the timeout.
Initially I had a sleep command but this is better (for me)
 
Old 02-02-2024, 12:59 PM   #23
inukaze
Member
 
Registered: Feb 2011
Location: Venezuela - Caracas
Distribution: Slackware64 14.2, Slackware 14.2, Gentoo, Devuan, gNewSense, GoboLinux, Leeenux, Porteus
Posts: 290

Original Poster
Rep: Reputation: 26
I had the follow configuration made it via netconfig

Hostname : Slack64
Domain Name : FUNDAPROAL
IPv4 Addresses : 10.48.8.212 -> Static IP
IPv4 Gateway : 10.48.8.1
Nameserver : 10.48.1.30

Ok, now is solved, just configuring it to use static ip, and during boot the internet access works. using NetworkManager the system wait until the Graphical Session and user session start to activate the internet access, and that was all issue.

Last edited by inukaze; 02-02-2024 at 02:28 PM.
 
  


Reply

Tags
rc.local, slackware64 15.0



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What are the best ways and practices to manage local SSL certificates with my own CA, to get local HTTPS sites like https://testsite.local ? ZhaoLin1457 Slackware 11 02-04-2021 04:15 PM
sudo and su - both are not working as i have removed my local user from local group RonakChauhan Linux - Newbie 4 05-18-2020 08:48 PM
[SOLVED] /etc/rc.d/rc.local vs /usr/local/share Lysander666 Slackware 4 11-16-2018 03:28 PM
Why and how settings of mounting NFS in /etc/rc.local are overrided with /etc/fstab? yglin Linux - Newbie 7 04-30-2014 05:40 AM
What is the difference between /etc/init.d/boot.local and /etc/rc.d/boot.local..? mozart Linux - Newbie 3 06-13-2007 06:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration