1 of 2
1
Yaws And setuid-drv
Posted: 16 April 2007 03:54 PM   [ Ignore ]
Newbie
Rank
Total Posts:  10
Joined  2007-04-16

Hi,
How can I retrieve the mandatory file setuid_drv, using CEAN ?

May be it’s possible to start yaws without ?
Thanks for your help…

Profile
 
 
Posted: 16 April 2007 06:10 PM   [ Ignore ]   [ # 1 ]
Moderator
Avatar
RankRankRank
Total Posts:  97
Joined  2006-11-13

this file is useless on windows,
I did not tested the whole thing, but I think a minimal service can run without that shared library.
it is actually provided for linux-x86 and darwin-powerpc
on other platforms, we need user contributions as I can not compile it.

if you can compile yaws on your system, you can send the .so to make your platform fully supported

Profile
 
 
Posted: 16 April 2007 06:12 PM   [ Ignore ]   [ # 2 ]
Moderator
Avatar
RankRankRank
Total Posts:  97
Joined  2006-11-13

all setuid_drv.so can be sent to: contrib (at) process-one (dot) net

Profile
 
 
Posted: 17 April 2007 09:07 AM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  10
Joined  2007-04-16

This is a Linux box
My problem is that I can’t start yaws.
application:start(yaws)
fails
yaws:start()
fails

This is related to the not found setuid_drv…
:(

I must compile it ?
May be I can just remove the setuid_drv need, this driver is only used to bind lower port number ?

Profile
 
 
Posted: 17 April 2007 05:26 PM   [ Ignore ]   [ # 4 ]
Moderator
Avatar
RankRankRank
Total Posts:  97
Joined  2006-11-13

yaws archive should extract the following files
yaws-1.68/priv/
yaws-1.68/priv/linux-x86/
yaws-1.68/priv/linux-x86/lib/
yaws-1.68/priv/linux-x86/lib/setuid_drv.so

if it can not find setuid_drv then you should have a problem with your environment.
can you
cd yaws-1.68/priv
ln -s linux-x86/lib

and test again ?

Profile
 
 
Posted: 17 April 2007 08:54 PM   [ Ignore ]   [ # 5 ]
Newbie
Rank
Total Posts:  10
Joined  2007-04-16

The link is already there, but when I start yaws:
./start.sh

1> yaws:start().

=ERROR REPORT==== 17-Apr-2007::21:50:03 ===
Failed to load setuid_drv (from “/home/rolphin/Desktop/Downloads/Erlang/erlang/lib/yaws-1.68/ebin/../priv/") : “cannot open shared object file: No such file or directory"{error,{shutdown,{yaws_app,start,[normal,[]]}}}
=ERROR REPORT==== 17-Apr-2007::21:50:03 ===
FATAL {’EXIT’,normal}

=INFO REPORT==== 17-Apr-2007::21:50:03 ===
application: yaws
exited: {shutdown,{yaws_app,start,[normal,[]]}}
type: permanent
2> {"Kernel pid terminated”,application_controller,"{application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}})

Now If I correctly link where the setuid_drv.so is searched (in ebin/../priv (sic !))
rolphin@karoten:~/Desktop/Downloads/Erlang/erlang/lib/yaws-1.68/priv$ ls -l
lrwxrwxrwx 1 rolphin rolphin 27 2007-04-17 21:51 setuid_drv.so -> linux-x86/lib/setuid_drv.so

I restart yaws:
1> yaws:start().

=ERROR REPORT==== 17-Apr-2007::21:52:19 ===
Failed to load setuid_drv (from “/home/rolphin/Desktop/Downloads/Erlang/erlang/lib/yaws-1.68/ebin/../priv/") : “Driver compiled with incorrect version of erl_driver.h"{error,{shutdown,{yaws_app,start,[normal,[]]}}}
=ERROR REPORT==== 17-Apr-2007::21:52:19 ===
FATAL {’EXIT’,normal}

“Driver compiled with incorrect version of erl_driver.h ...”

Are you sure that Yaws is correctly setup to work ? ;p

Profile
 
 
Posted: 17 April 2007 10:45 PM   [ Ignore ]   [ # 6 ]
Moderator
Avatar
RankRankRank
Total Posts:  97
Joined  2006-11-13

answer is no, i did not tested it. I should as yaws is a very important package.
problem for me is lack of time :(

first, yaws do not load setuid_drv the good way. yaws.erl must be patched
from:
1750 load_setuid_drv() ->
1751 Path = filename:dirname(code:which(?MODULE)) ++ “/../priv/”,
to:
1750 load_setuid_drv() ->
1751 Path = filename:join(code:priv_dir(?MODULE),"lib"),
this is a much more convenient way to load driver.

second, i build it using R11B-2, erl_driver.h may have changed ? I should consider built id with R11B-4…

Profile
 
 
Posted: 21 April 2007 06:11 PM   [ Ignore ]   [ # 7 ]
Newbie
Rank
Total Posts:  10
Joined  2007-04-16

Can I try to retrieve the new version ?
Having yaws working properly can really boost CEAN adoption… raspberry

Remember easyphp on windows ? The bad side is that kiddies will start using it, but unfortunately critical bugs will be harder to find smile
CLYME (Cean Linux Yaws Mnesia Erlang) raspberry ?

Profile
 
 
Posted: 22 April 2007 03:05 PM   [ Ignore ]   [ # 8 ]
Moderator
Avatar
RankRankRank
Total Posts:  97
Joined  2006-11-13

a working version of Yaws will be available on Monday
from now, Yaws will be actively tested before each new release.

Profile
 
 
Posted: 22 April 2007 07:09 PM   [ Ignore ]   [ # 9 ]
Newbie
Rank
Total Posts:  10
Joined  2007-04-16

Excellent news !

French elections wasn’t so good :/

Profile
 
 
Posted: 23 April 2007 02:19 PM   [ Ignore ]   [ # 10 ]
Moderator
Avatar
RankRankRank
Total Posts:  97
Joined  2006-11-13

ok, i patched actual yaws to make it work
i have another problem
2> yaws:start().

=ERROR REPORT==== 23-Apr-2007::15:13:36 ===
Yaws: Bad conf: “Can’t find no config file “

we may define a default yaws.conf, allowing to serve a simple page into cean installation.
but if we want yaws:start to work, then yaws_config should be patched.
I think best is to define a default yaws script into bin directory of cean installation.

any thought ?

Profile
 
 
Posted: 24 April 2007 01:18 PM   [ Ignore ]   [ # 11 ]
Newbie
Rank
Total Posts:  10
Joined  2007-04-16

Humm, why not define some priv/etc/ directory ?
May be we want to keep the yaws.conf file outside of the yaws tree ?

Another point I’ve downloadedd the latest version of cean with the latest yaws and keeps having this problem :
Eshell V5.5.4 (abort with ^G)
1> yaws:start().

=ERROR REPORT==== 24-Apr-2007::14:13:44 ===
Failed to load setuid_drv (from “/home/rolphin/Work/Devel/Erlang/Cean/erlang/lib/yaws-1.68/priv/linux-x86/lib") : “Driver compiled with incorrect version of erl_driver.h"{error,{shutdown,{yaws_app,start,[normal,[]]}}}
=ERROR REPORT==== 24-Apr-2007::14:13:44 ===
FATAL {’EXIT’,normal}

I didn’t have to make the link myself which is a good point.
I’ve just created a ~/yaws.conf for testing purpose with nothing special.

So may be we can have cean:yaws not need the setuid_drv since anyone can bind port over 1024 ?
If we really need bind of 80 we can fall back to linux CAPABILITIES to permit a user to do it ...

Profile
 
 
Posted: 25 April 2007 01:40 PM   [ Ignore ]   [ # 12 ]
Newbie
Rank
Total Posts:  10
Joined  2007-04-16

I’ve read the code of setuid_drv, and it seems to do more thant just setting the user id raspberry
Removing it may be more difficult…

So to move forward I just need a useable Makefile for Linux to test some modifications on yaws.erl.
Do you think that’s possible to have a Makefile ?

Profile
 
 
Posted: 26 April 2007 11:33 AM   [ Ignore ]   [ # 13 ]
Moderator
Avatar
RankRankRank
Total Posts:  97
Joined  2006-11-13

http://yaws.hyber.org/download/yaws-1.68.tar.gz
it includes configure and generate Makefile

Profile
 
 
Posted: 26 April 2007 12:39 PM   [ Ignore ]   [ # 14 ]
Newbie
Rank
Total Posts:  10
Joined  2007-04-16

Thank you, is this the one you also use ?

Profile
 
 
Posted: 26 April 2007 08:31 PM   [ Ignore ]   [ # 15 ]
Moderator
Avatar
RankRankRank
Total Posts:  97
Joined  2006-11-13

yes, as you can see:
http://cean.process-one.net/packages/index.yaws?action=detail&name=yaws

Profile
 
 
   
1 of 2
1