Am Montag, 9. März 2020, 21:14:41 CET schrieb Philip Smith: > I have some code that needs to run as root. I was planning to do this via > inetd the super-server and calling the code as root like example inetd.conf > here: > > myservice stream tcp nowait root /pathtomycode/mycode.fs mycode.fs -e > "startingword" > > This configuration works until i start to use c-library stuff. > The version of Gforth i am using is 0.7.9_20200206 > > If i first run the code as root from cmd line so the library stuff gets > compiled there is no problem and the library stuff gets put in > /root/.cache/gforth/arm/libcc-tmp path. > Then if i try to use curl to call the code via inetd i get errors telling > me "no such file or directory c-library mylibrary" . > I know the curl command is calling the code because if i remove the library > from the code i can make this stuff work. > My question is there some work around here to use a fixed path to my > library? > I did some testing using apache web server and i presume it uses www-data > as the user but it generates the same errors so it seems to me that > libcc.fs is trying to find some path that it cant find. > I see the path's used in libcc.fs having something like "~/.cache......" at > the start so i know it is done in that libcc.fs code but it seems to me > that the "~/" should allow the root access of inetd to work and yet it does > not! > > I know this is a complex problem and i am asking a lot here but any help > would be appreciated!
inetd probably has some jailing to prevent you to access ~/.cache or so. Anyways GFORTHCCPATH is the environment variable that is used as search path for libraries when set; and for build purpose, there's also libccdir (lowercase) that does the same thing. -- Bernd Paysan "If you want it done right, you have to do it yourself" net2o id: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ* https://net2o.de/
signature.asc
Description: This is a digitally signed message part.