Something like the following in `/etc/init`:

    description "Description Goes Here"
    author "Carl <[email protected]>"

    start on runlevel [2345]
    stop on runlevel [016]

    kill timeout 60
    respawn
    respawn limit 10 5
     
    script
    /usr/bin/sudo -u cas /bin/bash <<START
    cd /path/to/cas/ 
    ./executable/to/run
    START
    end script

E.g. if you call it /etc/init/cas.conf`, then you can do `start cas` `stop cas` 
`status cas`.  I liked upstart a lot better than systemd.  Not sure why it 
never caught on.

Thanks,
Carl Waldbieser
ITS Identity Management
Lafayette College

----- Original Message -----
From: "Adam Causey" <[email protected]>
To: "cas-user" <[email protected]>
Sent: Monday, November 13, 2017 3:45:20 PM
Subject: Re: [cas-user] Running CAS 5.1 as a service in linux

Sorry; I thought my server was Redhat 7, but it's still on Redhat 6. Are
there any examples for that version?

On Mon, Nov 13, 2017 at 3:30 PM, Waldbieser, Carl <[email protected]>
wrote:

> Adam,
>
> For CAS 5.1.5, I have something like this in `/etc/systemd/system/cas.
> service`:
>
>     # Systemd unit file for CAS (Central Authentication Service)
>     [Unit]
>     Description=Apereo CAS with embedded servlet container
>     After=syslog.target network.target
>
>     [Service]
>     Type=simple
>
>     Environment=JAVA_HOME=/etc/alternatives/java_sdk_1.8.0
>     Environment='JAVA_OPTS=-Djava.awt.headless=true
> -Djava.security.egd=file:/dev/./urandom'
>
>     WorkingDirectory=/var/local/cas
>     ExecStart=/bin/java -Dlog4j.configurationFile=file:/etc/cas/log4j2.xml
> -jar target/cas.war --cas.standalone.config.file=/etc/cas/cas.properties
>
>     User=cas
>     Group=cas
>
>     SuccessExitStatus=143
>
>     [Install]
>     WantedBy=multi-user.target
>
> It is probably not exactly right, but I can do `systemctl start cas`,
> `systemctl stop cas`, etc.
>
> Thanks,
> Carl Waldbieser
> ITS Identity Management
> Lafayette College
>
> ----- Original Message -----
> From: "Adam Causey" <[email protected]>
> To: "cas-user" <[email protected]>
> Sent: Monday, November 13, 2017 3:27:01 PM
> Subject: Re: [cas-user] Running CAS 5.1 as a service in linux
>
> Thanks. I'm looking to startup the embedded Tomcat. I have our older
> version of CAS running in external Tomcat.
>
> On Mon, Nov 13, 2017 at 3:07 PM, David Curry <[email protected]>
> wrote:
>
> > Embedded Tomcat or external Tomcat? If the latter, this might help:
> >
> > https://dacurry-tns.github.io/deploying-apereo-cas/setup_
> > tomcat_configure-systemd-to-start-tomcat.html
> >
> > But I'm not sure how helpful that is for the embedded option.
> >
> > --Dave
> >
> >
> > --
> >
> > DAVID A. CURRY, CISSP
> > *DIRECTOR OF INFORMATION SECURITY*
> > INFORMATION TECHNOLOGY
> >
> > 71 FIFTH AVE., 9TH FL., NEW YORK, NY 10003
> > <https://maps.google.com/?q=71+FIFTH+AVE.,+9TH+FL.,+NEW+
> YORK,+NY+10003&entry=gmail&source=g>
> > +1 212 229-5300 x4728 • [email protected]
> >
> > [image: The New School]
> >
> > On Mon, Nov 13, 2017 at 3:02 PM, Adam Causey <[email protected]> wrote:
> >
> >> I am running Redhat Enterprise 7 and would like to run CAS 5.1 as a
> >> service. I have done this with other spring boot apps, but CAS doesn't
> seem
> >> to work the same way. Is there a tutorial or docs on how to get this
> setup?
> >>
> >> Thanks,
> >> Adam
> >>
> >> --
> >> - Website: https://apereo.github.io/cas
> >> - Gitter Chatroom: https://gitter.im/apereo/cas
> >> - List Guidelines: https://goo.gl/1VRrw7
> >> - Contributions: https://goo.gl/mh7qDG
> >> ---
> >> You received this message because you are subscribed to the Google
> Groups
> >> "CAS Community" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to [email protected].
> >> To view this discussion on the web visit https://groups.google.com/a/ap
> >> ereo.org/d/msgid/cas-user/CAN6MV5NP_WEwRCGTXXUbdB5BmAbh4fkA3
> >> 1R_H7Q%3DOXFZmfCb5g%40mail.gmail.com
> >> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAN6MV5NP_
> WEwRCGTXXUbdB5BmAbh4fkA31R_H7Q%3DOXFZmfCb5g%40mail.gmail.
> com?utm_medium=email&utm_source=footer>
> >> .
> >>
> >
> > --
> > - Website: https://apereo.github.io/cas
> > - Gitter Chatroom: https://gitter.im/apereo/cas
> > - List Guidelines: https://goo.gl/1VRrw7
> > - Contributions: https://goo.gl/mh7qDG
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "CAS Community" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to [email protected].
> > To view this discussion on the web visit https://groups.google.com/a/
> > apereo.org/d/msgid/cas-user/CA%2Bd9XAM0hvwxHZwZ3X%2B%
> > 2B2mQsEuxmPh6i32C1uQdr60u%2B%3DOFh4g%40mail.gmail.com
> > <https://groups.google.com/a/apereo.org/d/msgid/cas-user/
> CA%2Bd9XAM0hvwxHZwZ3X%2B%2B2mQsEuxmPh6i32C1uQdr60u%2B%
> 3DOFh4g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> > .
> >
>
> --
> - Website: https://apereo.github.io/cas
> - Gitter Chatroom: https://gitter.im/apereo/cas
> - List Guidelines: https://goo.gl/1VRrw7
> - Contributions: https://goo.gl/mh7qDG
> ---
> You received this message because you are subscribed to the Google Groups
> "CAS Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/a/
> apereo.org/d/msgid/cas-user/CAN6MV5Mg%2Be3QDB%2Bhb8WHVjXg9zmRyZX02aPGp%
> 2BW4Vvoxj%3DyaaQ%40mail.gmail.com.
>
> --
> - Website: https://apereo.github.io/cas
> - Gitter Chatroom: https://gitter.im/apereo/cas
> - List Guidelines: https://goo.gl/1VRrw7
> - Contributions: https://goo.gl/mh7qDG
> ---
> You received this message because you are subscribed to the Google Groups
> "CAS Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/a/
> apereo.org/d/msgid/cas-user/1399395731.85655645.
> 1510605057344.JavaMail.zimbra%40lafayette.edu.
>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAN6MV5OFBD_UxWkv510CPf8vVV_pMNBcqTJjujsNFg02wpGrGw%40mail.gmail.com.

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/571047723.85687359.1510606202535.JavaMail.zimbra%40lafayette.edu.

Reply via email to