Uploaded image for project: 'JBoss Core Services'
  1. JBoss Core Services
  2. JBCS-531

Remove hardcoded user "Apache" from .postinstall script

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • httpd 2.4.23 GA
    • httpd
    • None
    • 2
    • ?
    • Hide

      Even if we start/install using a custom user it creates Apache user, local test done :

      • i have changed the user/group inside the httpd.conf as well to pragshar.

      ~~~~~~~~~~~~~~~~~~
      [pragshar@pragshar httpd]$ pwd
      /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd
      [pragshar@pragshar httpd]$ ./.postinstall
      [pragshar@pragshar httpd]$ cd sbin/
      [pragshar@pragshar sbin]$ pwd
      /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin
      [pragshar@pragshar sbin]$ ./apachectl start
      [pragshar@pragshar sbin]$ ./apachectl start
      httpd (pid 10554) already running
      [pragshar@pragshar sbin]$ ps -ef | grep httpd
      root 2275 1 0 06:11 ? 00:00:01 /home/pragshar/opt/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/opt/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/opt/jbcs-httpd24-2.4/httpd/logs/httpd.log -DFOREGROUND
      apache 2768 2275 0 06:11 ? 00:00:00 /home/pragshar/opt/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/opt/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/opt/jbcs-httpd24-2.4/httpd/logs/httpd.log -DFOREGROUND
      apache 2769 2275 0 06:11 ? 00:00:00 /home/pragshar/opt/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/opt/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/opt/jbcs-httpd24-2.4/httpd/logs/httpd.log -DFOREGROUND
      apache 2770 2275 0 06:11 ? 00:00:00 /home/pragshar/opt/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/opt/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/opt/jbcs-httpd24-2.4/httpd/logs/httpd.log -DFOREGROUND
      apache 2772 2275 0 06:11 ? 00:00:00 /home/pragshar/opt/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/opt/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/opt/jbcs-httpd24-2.4/httpd/logs/httpd.log -DFOREGROUND
      apache 2773 2275 0 06:11 ? 00:00:00 /home/pragshar/opt/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/opt/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/opt/jbcs-httpd24-2.4/httpd/logs/httpd.log -DFOREGROUND
      pragshar 10554 1 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start
      pragshar 10559 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start
      pragshar 10566 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start
      pragshar 10581 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start
      pragshar 10584 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start
      pragshar 10587 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start
      pragshar 10590 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start
      pragshar 10593 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start
      pragshar 10596 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start
      pragshar 10606 10490 0 12:04 pts/0 00:00:00 grep --color=auto httpd
      [pragshar@pragshar sbin]$
      ~~~~~~~~~~~~~~~~~~

      Show
      Even if we start/install using a custom user it creates Apache user, local test done : i have changed the user/group inside the httpd.conf as well to pragshar. ~~~~~~~~~~~~~~~~~~ [pragshar@pragshar httpd] $ pwd /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd [pragshar@pragshar httpd] $ ./.postinstall [pragshar@pragshar httpd] $ cd sbin/ [pragshar@pragshar sbin] $ pwd /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin [pragshar@pragshar sbin] $ ./apachectl start [pragshar@pragshar sbin] $ ./apachectl start httpd (pid 10554) already running [pragshar@pragshar sbin] $ ps -ef | grep httpd root 2275 1 0 06:11 ? 00:00:01 /home/pragshar/opt/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/opt/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/opt/jbcs-httpd24-2.4/httpd/logs/httpd.log -DFOREGROUND apache 2768 2275 0 06:11 ? 00:00:00 /home/pragshar/opt/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/opt/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/opt/jbcs-httpd24-2.4/httpd/logs/httpd.log -DFOREGROUND apache 2769 2275 0 06:11 ? 00:00:00 /home/pragshar/opt/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/opt/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/opt/jbcs-httpd24-2.4/httpd/logs/httpd.log -DFOREGROUND apache 2770 2275 0 06:11 ? 00:00:00 /home/pragshar/opt/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/opt/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/opt/jbcs-httpd24-2.4/httpd/logs/httpd.log -DFOREGROUND apache 2772 2275 0 06:11 ? 00:00:00 /home/pragshar/opt/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/opt/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/opt/jbcs-httpd24-2.4/httpd/logs/httpd.log -DFOREGROUND apache 2773 2275 0 06:11 ? 00:00:00 /home/pragshar/opt/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/opt/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/opt/jbcs-httpd24-2.4/httpd/logs/httpd.log -DFOREGROUND pragshar 10554 1 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start pragshar 10559 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start pragshar 10566 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start pragshar 10581 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start pragshar 10584 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start pragshar 10587 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start pragshar 10590 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start pragshar 10593 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start pragshar 10596 10554 0 12:04 ? 00:00:00 /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/sbin/httpd -f /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/conf/httpd.conf -E /home/pragshar/NotBackedUp/EWS/jbcs-httpd24-2.4/httpd/logs/httpd.log -k start pragshar 10606 10490 0 12:04 pts/0 00:00:00 grep --color=auto httpd [pragshar@pragshar sbin] $ ~~~~~~~~~~~~~~~~~~

      Post instillation script of Core HTTP Server creates unwanted user account 'apache'.

      ~~~
      63 # bz1178816
      64 /usr/sbin/useradd -c "Apache" -u 48 \
      65 -s /sbin/nologin -r -d ${currentDir} apache 2> /dev/null
      66 dav_lockdb_dir='/var/lib/dav'
      67 mkdir -p ${dav_lockdb_dir} 2> /dev/null
      68 chown apache ${dav_lockdb_dir} 2> /dev/null
      ~~~

              pprokopi@redhat.com Petros Marios Prokopiou (Inactive)
              rhn-support-pragshar Prageetika Sharma (Inactive)
              Jan Onderka Jan Onderka
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: