View Issue Details

IDProjectCategoryView StatusLast Update
0004316unrealircdpublic2014-06-12 05:20
Reporterrcnewman3 Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Product Version3.2.10.3 
Summary0004316: loadmodule fails with error "file not found" when file is present
DescriptionAfter modifying include/config.h so that Unrealircd would run as the user ircd, Unrealircd generated a "no such file or directory" error when attempting to load the commands module.

Steps To Reproducemake clean
Modified include/config.h to run ircd as user ircd rather than root
./Config
make
unreal start
Additional Informationsu root
cd ~
wget http://www.unrealircd.com/downloads/Unreal3.2.10.3.tar.gz
tar zxf Unreal3.2.10.3.tar.gz
cd Unreal3.2.10.3
pico /include/config.h
    searched (CTRL-w) for "#define CHROOTDIR"
    uncommented the line so CHROOTDIR would be defined
        
    searched (CTRL-w) for "#define IRC_USER"
    uncommented both the #define IRC_USER and IRC_GROUP
    Edited both values to "ircd"
    Exit(CTRL-x) and save
        
pico configure
    searched (CTRL-w) for "$CFLAGS -export-dynamic"
    modified CFLAGS="$CFLAGS -export-dynamic" ==> CFLAGS="$CFLAGS -Wl,-export-dynamic"
    searched (CTRL-w) for "$ac_cv_c_compiler_gnu"
    modified the value for ac_cv_pic to "-std=gnu89 -fPIC -DPIC -shared"
    Exit (CTRL-x) and save
pico configure.ac
    searched for the FLAGS="$CFLAGS -export-dynamic"
    editted the line to: CFLAGS="$CFLAGS -Wl,-export-dynamic"
    removed the line containing: ac_cv_pic="-fPIC -DPIC -shared"
        
./Config
    
When prompted for the directory of server config files:
    Enter: /usr/local/etc/Unreal
When prompted for the path to the ircd binary:
    Enter: /usr/local/libexec/ircd
Permissions: 0600
When prompted to support SSL connections:
    Enter: Yes
OpenSSL path: leave it blank
IPV6 Support: No
ZipLinks Support: No
Enable Remote Includes: No
Enable prefix for chanadmin and chanowner: Yes
Listen() Backlog value: 5
Nickname History: 2000
Max Sendq Length: 3000000
Number of buffer pools: 18
Number of file descriptors (or sockets): 1024
Custom parameters to configure: leave blank
Generate SSL cert: Yes
Country Name: ****
State: ********
city: *********
Organization Name: ***************
Organizational Unit Name: ****************************
Common name (server): mydevserver
        
The config process should complete in about 2-3 minutes
    
make
    
The compile process takes another 3-5 minutes

root@mydevserver:~/Unreal3.2.10.3 # cp src/ircd /usr/local/libexec
root@mydevserver:~/Unreal3.2.10.3 # cp src/modules/*.so /usr/local/lib/Unreal/
root@mydevserver:~/Unreal3.2.10.3 # cp unreal /usr/local/sbin
root@mydevserver:~/Unreal3.2.10.3 # unreal start
Starting UnrealIRCd
    _ _ _ ___________ _____ _
    | | | | | |_ _| ___ \/ __ \ | |
    | | | |_ __ _ __ ___ __ _| | | | | |_/ /| / \/ __| |
    | | | | '_ \| '__/ _ \/ _` | | | | | / | | / _` |
    | |_| | | | | | | __/ (_| | |_| |_| |\ \ | \__/\ (_| |
    \___/|_| |_|_| \___|\__,_|_|\___/\_| \_| \____/\__,_|
                      v3.2.10.3
                using TRE 0.8.0 (BSD)
                     using OpenSSL 1.0.1g 7 Apr 2014

* Loading IRCd configuration ..
* unrealircd.conf:38: loadmodule /usr/local/lib/Unreal/commands.so: failed to load: Cannot open module file: No such file or directory
[error] IRCd configuration failed to load
Possible error encountered (IRCd seemingly not started)
=====================================================
Check above for possible errors, and this output of
ircd.log. If you cannot solve the problem, read
Unreal.nfo on where to get support
=====================================================
[Fri Jun 6 14:32:18 2014] - UnrealIRCd started.
[Fri Jun 6 14:32:18 2014] - TIME SYNCH: Unable to synchronize time: Timeout. This means UnrealIRCd was unable to synchronize the IRCd clock to a known good time source. As long as the server owner keeps the server clock synchronized through NTP, everything will be fine.
[Fri Jun 6 14:34:36 2014] - UnrealIRCd started.
[Fri Jun 6 14:34:36 2014] - TIME SYNCH: IRCd clock succesfully synchronized to known good time source.
[Fri Jun 6 14:37:10 2014] - Connect - Joe!Adium@joebox1 [VHOST SCS-DCAA33A]
3rd party modules

Activities

syzop

2014-06-11 21:08

administrator   ~0018191

Sounds like you are not familiar with chrooting, let me explain: chroot()'ing means that the process will make a certain directory the new root directory. What this means in practice with UnrealIRCd: when you define CHROOTDIR on UnrealIRCd you tell it to lock itself up in DPATH.
DPATH is what you answer to "What directory are all the server configuration files in?" which is where you answered "/usr/local/etc/Unreal"

This means that after booting, the IRCd will make "/usr/local/etc/Unreal" the new "/" (in the eyes of the ircd process).

So if you want to load a module in /usr/local/etc/Unreal/modules/blah.so you need to load "modules/blah.so".

You tried to load /usr/local/lib/Unreal/commands.so but this will actually translate to /usr/local/etc/Unreal/usr/local/lib/Unreal/commands.so. It's impossible to load the real /usr/local/lib/... as this is outside the chroot of /usr/local/etc/Unreal.

Hope I didn't confuse you further :P. In that case a google on "chroot" may be more helpful.

rcnewman3

2014-06-11 21:44

reporter   ~0018192

Thank you for clarifying chrooting. I relocated the modules to "/usr/local/etc/Unreal/modules" and then updated my unrealircd.conf to load the required modules as "modules/commands.so" and "modules/cloak.so".

This resolved the issue with the modules and my misunderstanding of chrooting. I am now looking to figure out why UnrealIRCd does not fully start with the following message:

root@mydev1server:~ # unreal start
Starting UnrealIRCd
 _ _ _ ___________ _____ _
| | | | | |_ _| ___ \/ __ \ | |
| | | |_ __ _ __ ___ __ _| | | | | |_/ /| / \/ __| |
| | | | '_ \| '__/ _ \/ _` | | | | | / | | / _` |
| |_| | | | | | | __/ (_| | |_| |_| |\ \ | \__/\ (_| |
 \___/|_| |_|_| \___|\__,_|_|\___/\_| \_| \____/\__,_|
                           v3.2.10.3
                     using TRE 0.8.0 (BSD)
                     using OpenSSL 1.0.1g 7 Apr 2014

* Loading IRCd configuration ..
* Configuration loaded without any problems ..
* Loading tunefile..
* Initializing SSL.
* Dynamic configuration initialized .. booting IRCd.
---------------------------------------------------------------------
Possible error encountered (IRCd seemingly not started)
=====================================================
Check above for possible errors, and this output of
ircd.log. If you cannot solve the problem, read
Unreal.nfo on where to get support
=====================================================
#ircd.log created by RobertN on 2014-06-11

Stealth

2014-06-12 05:20

reporter   ~0018193

I'm closing this issue as it has turned into a support matter rather than a bug with UnrealIRCd. bugs.unrealircd.org is for reporting bugs that may be reproduced or to request features.

Please use http://forums.unrealircd.com or go to our IRC channel #unreal-support on irc.unrealircd.com (irc://irc.unrealircd.com/unreal-support) for further assistance with getting Unreal to boot.

Issue History

Date Modified Username Field Change
2014-06-11 17:24 rcnewman3 New Issue
2014-06-11 21:08 syzop Note Added: 0018191
2014-06-11 21:44 rcnewman3 Note Added: 0018192
2014-06-12 05:20 Stealth Note Added: 0018193
2014-06-12 05:20 Stealth Status new => closed
2014-06-12 05:20 Stealth Resolution open => no change required