LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-03-2015, 04:09 AM   #1
tecsoftware
LQ Newbie
 
Registered: Apr 2010
Posts: 4

Rep: Reputation: 1
Question the use of the & sign in the ifconfig commad


I found this script (part presented here) in the /etc/cron.hourly directory.

ifconfig $i up& (the $i in the do loop is either, lo (loopback), eth0 or eth1).

I know this turns the connection "on", but what effect is the & sign?
 
Old 04-03-2015, 04:13 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
& will put the process in the background, that means the cron will not wait for it any more.
 
Old 04-03-2015, 07:59 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Exactly what pan64 said.

But what does the script do next? Does it expect to use the network it just raised up? Because it may not yet be up, or never be up if circumstances do not allow. So the script is not blocked, but hopefully the script is checking status to determine if the network has connected.
 
Old 04-03-2015, 11:27 PM   #4
tecsoftware
LQ Newbie
 
Registered: Apr 2010
Posts: 4

Original Poster
Rep: Reputation: 1
agreed with you all...

I forgot about the background use of the &. Amazing how things get loss in the mind.

the command is part of a virus I found. IN "hourly" the Ethernet is raised along with local loop.

IN "cron.minute", multiple messages are sent every second, the overload shuts things down.


I was wondering why cron on Linux has these monthly, weekly and hour directories rather than the just the crontabs in the original unix systems? What would happen if they (month, week, etc,) were removed? or just remove the place holder.
 
1 members found this post helpful.
Old 04-04-2015, 12:19 AM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by tecsoftware View Post
the command is part of a virus I found. IN "hourly" the Ethernet is raised along with local loop.

IN "cron.minute", multiple messages are sent every second, the overload shuts things down.


I was wondering why cron on Linux has these monthly, weekly and hour directories rather than the just the crontabs in the original unix systems? What would happen if they (month, week, etc,) were removed? or just remove the place holder.
Well, that does not sound like a "virus", but just like a compomised system being exploited as a spam bot.

You really need to remove that system from network visibility immediately and fix whatever is going on with it.

Cron is really just cron... the hourly, daily and monthly are just convenience scripts that you can use to run jobs according to your own needs. It isn't so much a Linux thing as just some default choices made by the distro, which you should always reconfigure to suite your actual requirements.
 
  


Reply

Tags
ifconfig


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to change &amp;apos; to ' sign in ubuntu server rytec Linux - Software 5 06-10-2011 05:36 AM
sign making & engraving software cadsoft77 Linux - Software 1 10-18-2007 07:35 PM
ifconfig & iwconfig do not work Koneko Linux - Newbie 3 08-06-2005 10:04 PM
ifconfig -a & kernel 2.5.X problem uri yanai Linux - Networking 1 08-14-2003 10:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:45 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