Solaris 10 install issue - Fatal error in reader: Makefile, line 4

397 views
Skip to first unread message

Robert

unread,
Jun 29, 2017, 4:39:35 PM6/29/17
to ossec-list
I am having issues installing on Solaris 10 (i.e. Solaris 10 8/11 s10s_u10wos_17b SPARC) and am getting the error below when it tries to finish the install. 

5- Installing the system
 - Running the Makefile
make: Fatal error in reader: Makefile, line 4: Unexpected end of line seen

 Error 0x5.
 Building error. Unable to finish the installation.

The line in question is "uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') ".  The output from that command is below.

# sh -c 'uname -s 2>/dev/null || echo not' 
SunOS 

I tried changing the first line of the install.sh script to "#!/bin/bash" and that didn't work.  I checked our compilers and we have gcc installed but not cc.  Below is the gcc version.

# gcc --version
gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
Copyright (C) 2004 Free Software Foundation, Inc. 

Below is the output using the following command: /bin/sh -x ./install.sh.

MAKEBIN=make
+ [ XSunOS = XOpenBSD ] 
+ [ XSunOS = XFreeBSD ] 
+ [ XSunOS = XNetBSD ] 
+ [ XSunOS = XDragonflyBSD ] 
+ [ X%NUNAME = XBitrig ] 
+ echo  - Running the Makefile 
 - Running the Makefile
+ cd ./src 
+ [ X = X ] 
+ make PREFIX=/var/ossec TARGET=agent build 
make: Fatal error in reader: Makefile, line 4: Unexpected end of line seen
+ [ 1 != 0 ] 
+ cd ../ 
+ catError 0x5-build 
FILE=0x5-build
FILE_PATH=./etc/templates/en/errors/0x5-build.txt
+ isFile ./etc/templates/en/errors/0x5-build.txt 
FILE=./etc/templates/en/errors/0x5-build.txt
+ ls ./etc/templates/en/errors/0x5-build.txt 
+ [ 0 = 0 ] 
+ echo true 
+ return 0 
+ [ true = false ] 
+ cat ./etc/templates/en/errors/0x5-build.txt 

 Error 0x5.
 Building error. Unable to finish the installation. 

I also tried patching our install.sh script using the patch (src_init_update_sh.diff) that was provided in another thread but that patch doesn't work.  Not to mention that thread was back in 2013.

Any ideas?

Eero Volotinen

unread,
Jun 29, 2017, 7:04:48 PM6/29/17
to ossec-list, robert....@gmail.com
what is output of: 

make --version


as you can see from errormessage, problem is in the makefile.


--

---
You received this message because you are subscribed to the Google Groups "ossec-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ossec-list+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eero Volotinen

unread,
Jun 29, 2017, 7:10:26 PM6/29/17
to ossec-list, robert....@gmail.com
you could also try to edit file src/makefile:

find line 4:

uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')


and replace it with


uname_S=SunOS


and try again..


Eero

Patrick Tobin

unread,
Jun 29, 2017, 8:40:45 PM6/29/17
to ossec...@googlegroups.com, robert....@gmail.com

Not sure if this will help but these are the steps I took to build a binary installer for Solaris 10 (I did the same for 2.8.3 and it worked as well):

 

Compile OSSEC on Solaris 10 with OPENSSL Support

 

  1. Install opencsw pkgutil

      --> pkgadd -d http://get.opencsw.org/now

  2. Install OPENSSL and OPENSSL Libraries

      --> pkgutil -i libssl_dev

      --> pkgutil -i openssl_utils

  3. Download OSSEC Tar file

      --> wget http://www.ossec.net/files/ossec-hids-2.8.2.tar.gz

  4. Unzip the tar

      --> gunzip ossec-hids-2.8.2.tar.gz

  5. Untar the tar

      --> tar -xvf ossec-hids-2.8.2.tar.gz

  6. Change to the src dir

      --> cd ossec-hids-2.8.2/src

  7. Edit the Makeall file

      --> vi Makeall

  8. Change all instances of /bin/sh to /usr/bin/bash

      --> shift+:%s/\/bin\/sh/\/usr\/bin\/bash/g

      --> shift+:wq!

  9. Locate gcc and create softlink to cc

      --> which gcc

      --> cd to gcc dir

      --> ln -s <gccDir> cc

  10. Find where the OPENSSL Header resides

      --> find / -name opensslconf.h -print

  11. Update the OPENSSL check in the Makeall file

      --> cd /tmp/ossec-hids-2.8.2/src

      --> vi Makeall

      --> /ssl

      --> change "if [ -e /usr/sfw/include/openssl/opensslconf.h ]; then" to the path of the header from the find command in step 10

      --> escape shift+:wq!

  12. Start the build process

      --> make setagent

      --> make all (make sure you see "-DUSE_OPENSSL" in the agent_auth compile)

      --> make build

  13. Update the preloaded-vars.conf

      --> cd /tmp/ossec-hids-2.8.2/etc

      --> vi preloaded-vars.conf

      --> update the agent variables as needed and exit

  14. Test the new binaries

      --> cd /tmp/ossec-hids-2.8.2

      --> ./install.sh

      --> /var/ossec/bin/agent-auth -m <ossec server> -p <port> (should be successful with openssl support)

  15. Create new binary tar file for deployment

      --> cd /tmp

      --> tar -cvf ossec-solaris-binary-2.8.2.tar ossec-hids-2.8.2/

--

To unsubscribe from this group and stop receiving emails from it, send an email to ossec-list+...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

 

 

--


---
You received this message because you are subscribed to the Google Groups "ossec-list" group.

To unsubscribe from this group and stop receiving emails from it, send an email to ossec-list+...@googlegroups.com.

dan (ddp)

unread,
Jun 30, 2017, 5:34:35 PM6/30/17
to ossec...@googlegroups.com
On Thu, Jun 29, 2017 at 8:40 PM, Patrick Tobin
<patric...@syniverse.com> wrote:
> Not sure if this will help but these are the steps I took to build a binary
> installer for Solaris 10 (I did the same for 2.8.3 and it worked as well):
>
>
>
> Compile OSSEC on Solaris 10 with OPENSSL Support
>
>
>
> 1. Install opencsw pkgutil
>
> --> pkgadd -d http://get.opencsw.org/now
>
> 2. Install OPENSSL and OPENSSL Libraries
>
> --> pkgutil -i libssl_dev
>
> --> pkgutil -i openssl_utils
>
> 3. Download OSSEC Tar file
>
> --> wget http://www.ossec.net/files/ossec-hids-2.8.2.tar.gz
>
> 4. Unzip the tar
>
> --> gunzip ossec-hids-2.8.2.tar.gz
>
> 5. Untar the tar
>
> --> tar -xvf ossec-hids-2.8.2.tar.gz
>
> 6. Change to the src dir
>
> --> cd ossec-hids-2.8.2/src
>
> 7. Edit the Makeall file
>
> --> vi Makeall
>
> 8. Change all instances of /bin/sh to /usr/bin/bash
>
> --> shift+:%s/\/bin\/sh/\/usr\/bin\/bash/g
>
> --> shift+:wq!
>

It would be interesting to know what's broken in Solaris's sh.
Reply all
Reply to author
Forward
0 new messages