What are the ways to have cfjetty start on boot fo...
# adobe
m
What are the ways to have cfjetty start on boot for a linux machine. I did the add-on service install (way back when) and realized it did not automatically start during the boot up process. I am not sure if it was supposed to do that or not, but it did not. We are using CF2021 on Red Hat Enterprise Linux Server 7.9
It is running on the same server as our CF 2021 server
e
if you installed it correctly on your RHEL box, you should be able as root do " service enable jetty
m
Hmmm, service enable jetty gives this message:
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
Then executing systemctl does have ColdFusion in the list but not jetty. cf2021.service loaded active exited Adobe ColdFusion 2021 So I may have to manually add it.
e
I'll take it rhel is not your thing. so wget wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.17.v20190418/jetty-distribution-9.4.17.v20190418.tar.gz untar it with tar -zxvf 'version.tar.hz" then move it to opt/jetty with mv jetty-distribution-xxxx /opt/jetty add a user to run it, useradd -m "jettyjedi" & chown -R jettyjedi:jettyjedi /opt/jetty/ & mkdir /var/run/jetty & chown -R jettyjedi:jettyjedi /var/run/jetty Then link it : ln -s /opt/jetty/bin/jetty.sh /etc/init.d/jetty chkconfig 345 --add jetty now you can create a jetty location for your code. mkdir /opt/jetty/my_base_r_belong_to_us/ then add it to jetty start java -jar /opt/jetty/start.jar --add-to-start=http,deploy, re-add the permissions with chown to the /opt/jetty/my_base_r_belong_to_us vi /etc/default/jetty then add the following :
Copy code
JETTY_HOME=/opt/jetty
JETTY_BASE=/opt/jetty/my_base_r_belong_to_us
JETTY_USER=jettyjedi
JETTY_PORT=8080
JETTY_HOST=x.x.x.x
Note, this is specifically for JETTY, if you are trying to just run COLDFUSION at the start you would NOT DO THIS.. instead you would verify this exists, ls -lt /etc/rc.d/init.d/coldfusion if it exists, then you should be able to do : systemctl enable coldfusion && service start coldfusion. If you never installed the systemcl package, which I believe the latest version of 7.X RHEL supports, then you could use chkconfig 345 --add coldfusion
m
Thanks for the extra info. "I'll take it rhel is not your thing" - not a day in and day out. I was using unix in the early 90's, so a long time ago. My main thing is: should have the CF Add-ins install (which includes Jetty and SOLR) have automatically installed it so it started during boot and did it not install correctly or am I supposed to do this myself? I already have the Jetty and SOLR installed, running and performing well, so I rather not reinstall it, just to make it start on boot. A little more digging (and with a clue in your detailed instructions and dusting off the cobwebs) jetty or cfjetty is what CF installed it as, uses the older chkconfig/service method instead of systemctl method. In the
/etc/init.d
directory sure enough there was a sym link
cfjetty
to the cfjetty script in the jetty install directory. So I issued:
Copy code
chkconfig --add cfjetty
chkconfig cfjetty on
But after reboot it did not start. I then tried but still did not work:
Copy code
chkconfig --del cfjetty
chkconfig --add cfjetty

[root@Usslswebappd02 /etc]# ls -altr */*jetty*
lrwxrwxrwx 1 root root 41 Mar 27 09:03 init.d/cfjetty -> /app/coldfusion2021/cfusion/jetty/cfjetty
lrwxrwxrwx 1 root root 17 Jul 24 16:10 rc6.d/K14cfjetty -> ../init.d/cfjetty
lrwxrwxrwx 1 root root 17 Jul 24 16:10 rc1.d/K14cfjetty -> ../init.d/cfjetty
lrwxrwxrwx 1 root root 17 Jul 24 16:10 rc0.d/K14cfjetty -> ../init.d/cfjetty
lrwxrwxrwx 1 root root 17 Jul 24 16:11 rc4.d/S90cfjetty -> ../init.d/cfjetty
lrwxrwxrwx 1 root root 17 Jul 24 16:11 rc3.d/S90cfjetty -> ../init.d/cfjetty
lrwxrwxrwx 1 root root 17 Jul 24 16:11 rc2.d/S90cfjetty -> ../init.d/cfjetty
lrwxrwxrwx 1 root root 17 Jul 24 16:11 rc5.d/S90cfjetty -> ../init.d/cfjetty

[root@Usslswebappd02 /etc]# chkconfig --list cfjetty

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

cfjetty         0:off   1:off   2:off    3:on    4:on    5:on    6:off
When I did
service cfjetty start
it starts and works Eventually I looked at dmesg and was getting an error:
systemd-sysv-generator[606]: stat() failed on /etc/rc.d/init.d/cfjetty: No such file or directory
Eventually I copied the cfjetty script (instead of sym link) into the /etc/init.d directory and it worked after reboot!!!!! I just got to remember to copy the script again if there are any updates ARGH! So either a permissions or a file system issue during boot up. my_base_r_belong_to_us - 🤣🤣🤣
e
No worries, We have a couple of older RHEL boxes like yours where We have multiple "one off" customizations as something non-standard RHEL has done. 😕