Bash 'which' error in db_setup.sh script #662

Closed
DePierre opened this Issue Apr 17, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@DePierre
Contributor

DePierre commented Apr 17, 2016

When running OWTF bash scripts to configure/reset the database, an error is thrown as shown below:

$ ./scripts/db_setup.sh init 

------------------------- OWTF Database Helper Script -------------------------
                    Helps in creation of user and database                     
-------------------------------------------------------------------------------

[+] Ensure that you have required values in /root/.owtf/db.cfg

Press Enter to continue

CREATE ROLE
CREATE DATABASE
Having SSL=true in postgres config causes many errors (psycopg2 problem)
Remove SSL=true from the PostgreSQL config?[Y/n]n
Restarting the postgresql service
which: no service in (/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/pin)

While the script seems to offer to possibility to use systemctl instead of service, the bash line is not correct and an error is thrown as soon as service is not found.

(Maybe line https://github.com/owtf/owtf/blob/develop/scripts/db_setup.sh#L51 and https://github.com/owtf/owtf/blob/develop/scripts/db_run.sh#L73 ?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment