• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

restart

Rebuild Docker containers

December 12, 2021

How to rebuild your application from scratch using Docker.

#!/bin/bash
docker-compose down -v
docker rmi $(docker images -a -q)
docker-compose up -d
docker-compose restart -t 10

#!/bin/bash docker-compose down -v docker rmi $(docker images -a -q) docker-compose up -d docker-compose restart -t 10

Steps

  • Purge the containers.
  • Delete docker images.
  • Reinitiate docker.
  • Restart docker.

Filed Under: Cloud, Linux Tagged With: application, containers, docker, docker-compose, down, rebuild, remove, restart, up

Tomcat Install

June 4, 2021

Tomcat requires JRE.

wget jre-8uversion-linux-x64.tar.gz
# or
apt-get install default-jdk

wget jre-8uversion-linux-x64.tar.gz # or apt-get install default-jdk

Install Tomcat 8 on Linux.

wget https://mirrors.gigenet.com/apache/tomcat/tomcat-8/v8.5.66/bin/apache-tomcat-8.5.66.tar.gz
tar zxpvf apache-tomcat-8.5.66.tar.gz
cd /opt/tomcat/apache-tomcat-8.5.66/bin/
./startup.sh

wget https://mirrors.gigenet.com/apache/tomcat/tomcat-8/v8.5.66/bin/apache-tomcat-8.5.66.tar.gz tar zxpvf apache-tomcat-8.5.66.tar.gz cd /opt/tomcat/apache-tomcat-8.5.66/bin/ ./startup.sh

Status|Start|Stop|Restart Tomcat.

systemctl status tomcat8
systemctl start tomcat8
systemctl stop tomcat8
systemctl restart tomcat8

systemctl status tomcat8 systemctl start tomcat8 systemctl stop tomcat8 systemctl restart tomcat8

Filed Under: Misc Tagged With: apache, install, restart, server, start, status, stop, tomcat, web

Winbind Fix

May 24, 2021

Here’s the process to restore Winbind.

Restore old config.

cp /etc/sssd/sssd.conf-xxxxxxx /etc/sssd/sssd.conf
cp /etc/krb5.conf-xxxxxxx /etc/krb5.conf

cp /etc/sssd/sssd.conf-xxxxxxx /etc/sssd/sssd.conf cp /etc/krb5.conf-xxxxxxx /etc/krb5.conf

Disable SSSD. Authconfig creates /etc/nswitch.conf.

authconfig --disablesssd --disablesssdauth --updateall

authconfig --disablesssd --disablesssdauth --updateall

Start Winbind.

service winbind start; service smb start; service nmb start

service winbind start; service smb start; service nmb start

Filed Under: Linux Tagged With: disable, restart, restore, winbind

GCE Agent Bash

May 11, 2020

This is a Bash script to restart a service.

#!/bin/bash
 
SERVICE=google_osconfig_agent
AGENT=google-osconfig-agent
 
if (( $(ps -ef | grep -v grep | grep $SERVICE | wc -l) > 0 ))
then
    echo "$AGENT service running, everything is fine"
else
    echo "$AGENT is not running"
    echo "Restarting service"
    systemctl start $AGENT
    sleep 5s
    if (( $(ps -ef | grep -v grep | grep $SERVICE | wc -l) > 0 ))
    then
      sleep 2s
      echo "$AGENT service is now running"
    fi
fi

#!/bin/bash SERVICE=google_osconfig_agent AGENT=google-osconfig-agent if (( $(ps -ef | grep -v grep | grep $SERVICE | wc -l) > 0 )) then echo "$AGENT service running, everything is fine" else echo "$AGENT is not running" echo "Restarting service" systemctl start $AGENT sleep 5s if (( $(ps -ef | grep -v grep | grep $SERVICE | wc -l) > 0 )) then sleep 2s echo "$AGENT service is now running" fi fi

Filed Under: Cloud, Linux Tagged With: agent, bash, gce, restart

GCE Agent Powershell

May 11, 2020

This is a Powershell script to restart a service if it’s down.

$ServiceName = 'GCEAgent'
$arrService = Get-Service -Name $ServiceName
 
if ($arrService.Status -ne 'Running')
{
 
    Start-Service $ServiceName
    write-host $arrService.status
    write-host 'Service starting'
    Start-Sleep -seconds 60
    $arrService.Refresh()
    if ($arrService.Status -eq 'Running')
    {
        Write-Host 'GCE Agent Service is now Running'
    }
 
}
else
{
    Write-Host 'GCE Agent Service is Running'
}

$ServiceName = 'GCEAgent' $arrService = Get-Service -Name $ServiceName if ($arrService.Status -ne 'Running') { Start-Service $ServiceName write-host $arrService.status write-host 'Service starting' Start-Sleep -seconds 60 $arrService.Refresh() if ($arrService.Status -eq 'Running') { Write-Host 'GCE Agent Service is now Running' } } else { Write-Host 'GCE Agent Service is Running' }

Filed Under: Cloud, Windows Tagged With: check, powershell, restart, service

WordPress Permalinks Not Working

January 28, 2020

Here’s a couple of things you can do to check if WordPress permalinks is not working.

  1. Make sure .htaccess has the right permissions.
  2. Make sure a2enmod Apache module is enabled.
  3. Restart the Apache server.
chmod 664 /var/www/domain.com/.htaccess
a2enmod rewrite
systemctl restart apache2

chmod 664 /var/www/domain.com/.htaccess a2enmod rewrite systemctl restart apache2

Filed Under: Linux Tagged With: .htaccess, a2enmod, apache, restart, rewrite, wordpress

NFS Fails to Mount on Bootup

July 28, 2019

Check if rpcbind is running.

service rpcbind status|start|stop|restart

service rpcbind status|start|stop|restart

Or you can also clean the NFS cache.

service rpcbind stop
service nfslock stop
rm -rf /var/lib/nfs/statd/sm/*
rm -rf /var/lib/nfs/statd/sm.bak/*
service rpcbind start
service nfslock start

service rpcbind stop service nfslock stop rm -rf /var/lib/nfs/statd/sm/* rm -rf /var/lib/nfs/statd/sm.bak/* service rpcbind start service nfslock start

Filed Under: Linux Tagged With: aws, nfs, restart, rpcbind

Restart SSSD Service

January 4, 2019

Just documenting how to restart SSSD service. SSSD is a service that allows Active Directory groups access to Linux systems.

systemctl restart sssd.service

systemctl restart sssd.service

For other or older Linux distros, you may have to use this:

service sssd restart

service sssd restart

You can always try the other if one doesn’t work.

Filed Under: Linux Tagged With: restart, service, sssd

  • Home
  • About
  • Archives

Copyright © 2023