Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 01 Sep 2014, 03:56
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Bash/Shell script - make it loop forever??[SOLVED]
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [18 Posts]   Goto page: Previous 1, 2
Author Message
greengeek

Joined: 20 Jul 2010
Posts: 2509
Location: New Zealand

PostPosted: Mon 11 Mar 2013, 15:15    Post subject:  

SFR wrote:
Basically it's a nice looking one-liner, which multiplies itself (or rather its own process) ad infinitum, what makes system completely freezed.
Sadly, Puppy isn't immune for that kind of attack..!
It's very handy for me to know that I need to take care to avoid such risks. I'm always keen to tinker and "have a bash" so I would've dived in and locked up my system for sure... Smile Wiki suggests this as a means of prevention:
Quote:
As a fork bomb's mode of operation is entirely encapsulated by creating new processes, one way of preventing a fork bomb from severely affecting the entire system is to limit the maximum number of processes that a single user may own.
I wonder if this might be possible on Puppy.

BTW - My reason for wanting these scripts to help with mouse movement is to allow an inexperienced or physically challenged user to easily select between a limited number of mousepointer_position_choices. That way they can have some degree of functionality by having a "mouseclick" button, but no actual ability to move the mouse anywhere I don't want it to go.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1063

PostPosted: Mon 11 Mar 2013, 15:55    Post subject:  

greengeek wrote:
SFR wrote:
infinite loop, but deprived of deadly "fork" mechanism) can be utilized as well:
Code:
:(){ echo "Loop..."; sleep 1; :; };:

But of course this is not a good idea to have something like that in your code, so consider this as a "tip of the day".
Do you mean that it's not a good idea because it's so easy to get it wrong (and include a recursive fork by mistake)?

That too, but primarily, because 'while...' or 'until...' are most simple/common/readable methods.
But it may be useful, for example, if you'd like to deliberately obfuscate the code.
greengeek wrote:
Wiki suggests this as a means of prevention:
Quote:
As a fork bomb's mode of operation is entirely encapsulated by creating new processes, one way of preventing a fork bomb from severely affecting the entire system is to limit the maximum number of processes that a single user may own.

I wonder if this might be possible on Puppy.

Hard to say...
Quote:
# ulimit -a | grep "max user processes"
max user processes (-u) 30948
#

shows that max. number of processes is limited, but it doesn't seem to work (maybe it doesn't affect root account?).

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2509
Location: New Zealand

PostPosted: Tue 16 Jul 2013, 15:33    Post subject:  

This thread morphed into an expanded topic tracing the development of SFRs "OneSwitch" pet for disabled users. New thread can be found here:
http://murga-linux.com/puppy/viewtopic.php?t=87418
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [18 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0570s ][ Queries: 11 (0.0049s) ][ GZIP on ]