Discussion:
[Ledger-smb-users] Freebsd 11 Ledgersmb 1.5.6
Geordie
2017-04-17 18:41:07 UTC
Permalink
Hi
I have encountered some errors while starting LedgerSMB. There is a good
possibility I have messed things up. As a side note I have played with
permission on the the folder /usr/local/www/ledgersmb
Tried root:wheel
www:www
ledgersmb:ledgersmb
and basically get the same results
results below with www:www

I am sure this matters ledgersmb is in a jail

uname -a
FreeBSD jledgersmb15 11.0-STABLE FreeBSD 11.0-STABLE #0 r314815: Tue
Mar 7 09:28:20 EST 2017

Ledgersmb 1.5.6 from git

# starman -l :8080 -www ledgersmb -group
www /usr/local/www/ledgersmb/tools/starman.psgi 2017/04/17-14:23:53
Starman::Server (type Net::Server::PreFork) starting! pid(51196)
Resolved [*]:8080 to [::]:8080, IPv6 Resolved [*]:8080 to
[0.0.0.0]:8080, IPv4 Binding to TCP port 8080 on host :: with IPv6
Binding to TCP port 8080 on host 0.0.0.0 with IPv4
Setting gid to "80 80"
Passed serialize value of none is incompatible with multiple ports -
using default serialize No configuration file; running with default
settings No configuration file; running with default settings
No configuration file; running with default settings
No configuration file; running with default settings
No configuration file; running with default settings
Error while loading /usr/local/www/ledgersmb/tools/starman.psgi:
==============================================================================
== Running a Web Service as root is a security problem == If you are
starting LedgerSMB as a system service == please make sure that you
drop privlidges as per README.md == and the example files in conf/
== This makes it difficult to run on a privlidged port (<1024)
== In theory you can pass the --user argument to starman,
== However starman drops privlidges too late, starting us as root.
==============================================================================
at /usr/local/www/ledgersmb/tools/../lib/LedgerSMB/Sysconfig.pm line
469. Compilation failed in require
at /usr/local/www/ledgersmb/tools/../lib/LedgerSMB/App_State.pm line 9.
BEGIN failed--compilation aborted
at /usr/local/www/ledgersmb/tools/../lib/LedgerSMB/App_State.pm line 9.
Compilation failed in require
at /usr/local/www/ledgersmb/tools/../lib/LedgerSMB/Setting.pm line 58.
BEGIN failed--compilation aborted
at /usr/local/www/ledgersmb/tools/../lib/LedgerSMB/Setting.pm line 58.
Compilation failed in require
at /usr/local/www/ledgersmb/tools/../lib/LedgerSMB/PGNumber.pm line 15.
BEGIN failed--compilation aborted
at /usr/local/www/ledgersmb/tools/../lib/LedgerSMB/PGNumber.pm line 15.
Compilation failed in require
at /usr/local/www/ledgersmb/tools/../lib/LedgerSMB.pm line 149. BEGIN
failed--compilation aborted
at /usr/local/www/ledgersmb/tools/../lib/LedgerSMB.pm line 149.
Compilation failed in require
at /usr/local/www/ledgersmb/tools/../lib/LedgerSMB/PSGI.pm line 19.
BEGIN failed--compilation aborted
at /usr/local/www/ledgersmb/tools/../lib/LedgerSMB/PSGI.pm line 19.
Compilation failed in require
at /usr/local/www/ledgersmb/tools/starman.psgi line 13. BEGIN
failed--compilation aborted
at /usr/local/www/ledgersmb/tools/starman.psgi line 13. same results
with # starman -I lib --listen
localhost:5762 /usr/local/www/ledgersmb/tools/starman.psgi

Thanks
Geordie
David G
2017-04-18 02:54:21 UTC
Permalink
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Geordie
2017-04-18 20:57:56 UTC
Permalink
On Tue, 18 Apr 2017 10:54:21 +0800
Hi Geordie,
Ok, a couple of things stand out here.
Hi
Post by Geordie
I have encountered some errors while starting LedgerSMB. There is a
good possibility I have messed things up. As a side note I have
played with permission on the the folder /usr/local/www/ledgersmb
Tried root:wheel
www:www
ledgersmb:ledgersmb
and basically get the same results
results below with www:www In actual fact, it shouldn't matter at
all what the permissions on the directory (and contained files)
are, as long as the user that *RUNS* LedgerSMB has permission to
READ all of the LedgerSMB files and execute any that have their
execute bit set out of the box.
Generally we recommend creating a special system user (ledgersmb or
similar) that is used to RUN LedgerSMB
NOTE: As with any web app, the RUNNING user should NEVER have WRITE
permissions to ANYTHING except the tempdir and backupdir
Post by Geordie
I am sure this matters ledgersmb is in a jail
uname -a
FreeBSD jledgersmb15 11.0-STABLE FreeBSD 11.0-STABLE #0 r314815: Tue
Mar 7 09:28:20 EST 2017
Ledgersmb 1.5.6 from git
Looks like the cause of most of your errors is probably here,#
starman -l :8080 -www ledgersmb -group For the 1.5 series you need
a slightly different starman commandline.
If you have a look at README.md and
conf/systemd/ledgersmb_starman.service you will notice that the
"standard" command to start LedgerSMB is.... starman --listen
localhost:5762 -I lib tools/starman.psgi
Post by Geordie
Before running that, you should already be in the correct
directory, and it should be run as the correct user
The following bash script should be adequate if sudo is available on
the system. If sudo isn't installed you would need to either install
it, modify the script to use su, or modify the script to be run as
the correct user by some other mechanism.
#!/bin/bash
Post by Geordie
clear;
####
# setup the user and group to run LedgerSMB as
###
LSMB_User='ledgersmb'
LSMB_Group='ledgersmb'
LSMB_installdir='/usr/local/www/ledgersmb'
####
# You may need to set the following variables if you are using
local::lib and NOT running this script as the installing user ####
#    export PERL5LIB='/home/ledgersmb/perl5/lib/perl5'
#    export PERL_LOCAL_LIB_ROOT='/home/ledgersmb/perl5/lib/perl5'
#    export PERL_MB_OPT=--install_base "/home/ledgersmb/perl5"
#    export PERL_MM_OPT=INSTALL_BASE=/home/ledgersmb/perl5
####
# Run starman and LedgerSMB with as the user $LSMB_User
# Also ensure any local::lib environment variables are correctly
set. #   They are taken from values set above, or if not set from
the invoking users environment #   The PERL_MB_OPT and PERL_MM_OPT
variables normally wouldn't be needed to run LedgerSMB, #   but are
needed in the environment used to update any cpan perl modules ####
sudo -u $LSMB_User bash <<EOScript
    [[ -n "${PERL5LIB}" ]] && {
        export PERL5LIB='${PERL5LIB}';
        [[ -n "${PERL_LOCAL_LIB_ROOT}" ]] && export
PERL_LOCAL_LIB_ROOT='$PERL_LOCAL_LIB_ROOT'; # use single quotes to
ensure the var retains it's integrity [[ -n "${PERL_MB_OPT}" ]] &&
export PERL_MB_OPT='$PERL_MB_OPT'; # use single quotes to ensure
the var retains it's integrity [[ -n "${PERL_MM_OPT}" ]] && export
PERL_MM_OPT='$PERL_MM_OPT'; # use single quotes to ensure the var
retains it's integrity PATH="${PERL5LIB:+${PERL5LIB}:}\${PATH}"; }
cd ~/src/1-LedgerSMB/master && starman -l *:5762 -I lib
tools/starman.psgi EOScript
I'll talk to the other devs and see if we can add that script (or
similar) to the repository
Hi DavidG

The 4 jails that I set up over the last 5 days were all with user:group
ledgersmb with /usr/home/ledgersmb

my results today with starman -I lib --listen
localhost:5762 /usr/home/ledgersmb/LedgerSMB/tools/starman.psgi were
even more horrific. I did not try your script I apologise.

So after 8 years of using LedgerSMB I think I will move on. I can only
recall one year where the install wasn't terrible

Also I am new to Freebsd and it is not the same as Debian. So that too
is a learning curve

I do appreciate your help

Thanks
Geordie

Loading...