[jbosstools-issues] [JBoss JIRA] (JBIDE-25811) Create cron job which reconnect drive with jboss-nexus-public-jboss repository

Lukáš Valach (JIRA) issues at jboss.org
Thu Mar 15 08:47:00 EDT 2018


    [ https://issues.jboss.org/browse/JBIDE-25811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13546426#comment-13546426 ] 

Lukáš Valach commented on JBIDE-25811:
--------------------------------------

As a root, I added following crone expressin: 
*/2 * * * * /etc/sysconfig/mount_nexus_repo

I created script mount_nexus_repo which looks like this:
{code}
# This script is triggered by cron (crontab -e), it checks periotically if Nexus repository (/dev/vdb) is mounted on /home/hudson/repo
folder. If not, it will reconnect it and restart Nexus.
# Script has to be executed under root user.
# Log messages may be found in /var/spool/mail/root 

if ! df -h | grep -q '/dev/vdb.*/home/hudson/repo'; then
        echo Volume /dev/vdb is not mounted. It will be reconnected and then Nexus will be restarted.
        mount /dev/vdb /home/hudson/repo && service nexus restart
else
        # echo Volume /dev/vdb in mounted on /home/hudson/repo, everythink is ok.
fi 
{code}

The instance of Nexus server is handmake so I won't store this script at [gitlab|https://gitlab.mw.lab.eng.bos.redhat.com/], instead of them I created a snapshot of Nexus instance named *rhel-nexus*.

> Create cron job which reconnect drive with jboss-nexus-public-jboss repository
> ------------------------------------------------------------------------------
>
>                 Key: JBIDE-25811
>                 URL: https://issues.jboss.org/browse/JBIDE-25811
>             Project: Tools (JBoss Tools)
>          Issue Type: Enhancement
>          Components: integration-platform
>    Affects Versions: 4.5.3.AM3
>            Reporter: Lukáš Valach
>            Assignee: Lukáš Valach
>             Fix For: 4.5.3.AM3
>
>
> There is network drive mounted to the Nexus where the "jboss-nexus-public-jboss" repository is stored. Time to time drive is disconnected and repository becomes unavailable. Then Jenkins jobs are failing until somebody reconnect the drive. It will be fine to have this process automated.
> We need something like this:
> {code}
> if /dev/vdb is not mounted on /home/hudson/repo then
> sudo mount /dev/vdb /home/hudson/repo
> service nexus restart
> {code}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)



More information about the jbosstools-issues mailing list