Current time: 11-15-2024, 07:38 AM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
changeset 2489
Author Message
monotek Offline
Junior Member
*

Posts: 65
Joined: Dec 2006
Reputation: 0
Post: #1
changeset 2489
I just saw that there was changes in file trunk/configs/ubuntu/init.d/ispcp_network.

There is a change of "#!/bin/bash" to "#!/bin/sh".

Imho thats no good idea because "/bin/sh" is not linked to "/bin/bash" in ubuntu. Its linked to /bin/dash.

I allready had problems with some bash scripts because "#!/bin/sh" and therefore /bin/dash was used.

Maybe other distros are affected too.
01-01-2010 12:48 AM
Find all posts by this user Quote this message in a reply
TheCry Away
Member
***

Posts: 851
Joined: Oct 2008
Reputation: 21
Post: #2
RE: changeset 2489
Dash is very poor...
This is the first what i change if i install a new ubuntu server.
Use the following command to change dash to bash
Code:
ln -sf /bin/bash /bin/sh
Then all will work perfect!
01-01-2010 01:00 AM
Find all posts by this user Quote this message in a reply
Nuxwin
Unregistered

 
Post: #3
RE: changeset 2489
HI ;

(01-01-2010 12:48 AM)monotek Wrote:  I just saw that there was changes in file trunk/configs/ubuntu/init.d/ispcp_network.

There is a change of "#!/bin/bash" to "#!/bin/sh".

Imho thats no good idea because "/bin/sh" is not linked to "/bin/bash" in ubuntu. Its linked to /bin/dash.

I allready had problems with some bash scripts because "#!/bin/sh" and therefore /bin/dash was used.

Maybe other distros are affected too.

You take me for a fool? Big Grin

That's why I rewrote the init scripts according POSIX ! ! !

Test syntax with the new version:

Code:
nuxwin@dev:~$ ls /bin/sh -la
lrwxrwxrwx 1 root root 4 déc 31 17:46 /bin/sh -> dash

nuxwin@dev:~/Desktop/svn/trunk/configs/ubuntu/init.d$ ls -la /bin/dash
-rwxr-xr-x 1 root root 84084 aoû 26  2008 /bin/dash

nuxwin@dev:~/Desktop/svn/trunk/configs/ubuntu/init.d$ dash -n ispcp_network
nuxwin@dev:~/Desktop/svn/trunk/configs/ubuntu/init.d$

No error, so, it's ok. If you don't understand, read the related ticket before comment ! ! !

Also, thank you watched all the changes that were made. If you look closely, you'll see that I deleted the specific part to bash.

Code:
SERVICES=(
57                 # HTTP(S)
58                          80     443
59                 # POP3(S)
60                         110     995
61                 # IMAP4(S)
62                         143     993
63                 # SMTP(S)/SUBMIT
64                          25     465     587
65         )

replaced by
Code:
56    #
57    # HTTP(S): 80 443
58    # POP3(S): 110 995
59    # IMAP4(S)): 143 993
60    # MAIL(S): 25 465 587
61    SERVICES="80 443 110 143 25 465 587 995 993"

It's not for nothing !

See my comment here http://www.isp-control.net/ispcp/ticket/2132 and read that too https://wiki.ubuntu.com/DashAsBinSh

There is an explanation. The init script should not be written in bash because it is much slower than SH. This slows the boot process.

If you do not like dash, you'll be served as will be the default shell in Debian.

Cheers ;
(01-01-2010 01:00 AM)TheCry Wrote:  Dash is very poor...
This is the first what i change if i install a new ubuntu server.
Use the following command to change dash to bash
Code:
ln -sf /bin/bash /bin/sh
Then all will work perfect!

Sorry my friend, That is not good manner with debian based system. Use this command instead if you want really change the SHELL

Code:
$ sudo dpkg-reconfigure dash
01-01-2010 02:30 AM
Quote this message in a reply
monotek Offline
Junior Member
*

Posts: 65
Joined: Dec 2006
Reputation: 0
Post: #4
RE: changeset 2489
Thanks for your kind words.

I just wanted to notice, that there CAN be problems when /bin/sh is linked to /bin/dash.

I never tested the script because i currently not run ispcp.

Nevertheless... Happy new years eve :-)
01-01-2010 02:59 AM
Find all posts by this user Quote this message in a reply
Nuxwin
Unregistered

 
Post: #5
RE: changeset 2489
(01-01-2010 02:59 AM)monotek Wrote:  Thanks for your kind words.

I just wanted to notice, that there CAN be problems when /bin/sh is linked to /bin/dash.

I never tested the script because i currently not run ispcp.

Nevertheless... Happy new years eve :-)

Sorry if I offended you. Simply, I'm tired of seeing people tell everything and anything, See people who say the same thing without taking the time to try to understand.

I have nothing against you, I'm just tired. Please accept my apology if I have hurt you. Wink
01-01-2010 03:03 AM
Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #6
RE: changeset 2489
Hi monotek

I also saw the changes but I also saw the message nuxwin added to the changeset. Then it was clear.

Yes - we had alot of problems with dash being the default shell (starting with our makefiles etc etc). If we can use POSIX standard then I's also say: use the smallest/fastest shell available....
If this is usefull here (a productive server won't be started every day - but maybbe a developers server :-) is a different question :-)

/J
01-01-2010 03:26 AM
Visit this user's website Find all posts by this user Quote this message in a reply
monotek Offline
Junior Member
*

Posts: 65
Joined: Dec 2006
Reputation: 0
Post: #7
RE: changeset 2489
(01-01-2010 03:03 AM)nuxwin Wrote:  Sorry if I offended you. Simply, I'm tired of seeing people tell everything and anything, See people who say the same thing without taking the time to try to understand.

I have nothing against you, I'm just tired. Please accept my apology if I have hurt you. Wink

No problem :-)
I dont wanted to blame you too...

Im not that deep into all the development stuff right now, therefore i dont know that you allready know about the problems with /bin/dash.

I just look frequently to trac to have a quick overview of development status and try to help when i discover some things which could be a potential problem.

I hope i can give better feedback when i go to change my current controlpanal syscp to ispcp and have a better overview over all the things which happen here.

Thanks @ all ispcp developers :-)
Keep up the good work!
(This post was last modified: 01-01-2010 04:04 AM by monotek.)
01-01-2010 04:03 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)