Ruantiblock update error another instance of update is already running

Использование tor или VPN для доступа к заблокированным сайтам - ruantiblock/ruantiblock.sh at master · gSpotx2f/ruantiblock
#!/bin/sh ######################################################################## # # ruantiblock # # URL: https://github.com/gSpotx2f/ruantiblock # ######################################################################## ############################## Settings ################################ ### Режим обработки пакетов в правилах iptables (1 — Tor, 2 — VPN) PROXY_MODE=1 ### Применять правила проксификации для трафика локальных сервисов роутера (0 — off, 1 — on) PROXY_LOCAL_CLIENTS=1 ### Порт транспарентного proxy tor (параметр TransPort в torrc) TOR_TRANS_PORT=9040 ### DNS-сервер для резолвинга в домене .onion (tor) export ONION_DNS_ADDR=«127.0.0.1#9053« ### Html-страница с инфо о текущем статусе (0 — off, 1 — on) HTML_INFO=1 ### Запись событий в syslog (0 — off, 1 — on) export USE_LOGGER=1 ### Режим полного прокси при старте скрипта (0 — off, 1 — on). Если 1, то весь трафик всегда идёт через прокси. Все пакеты попадающие в цепочку $IPT_CHAIN попадают в tor или VPN, за исключением сетей из $TOTAL_PROXY_EXCLUDE_NETS. Списки блокировок не используются для фильтрации. Работает только при PROXY_LOCAL_CLIENTS=0 DEF_TOTAL_PROXY=0 ### Трафик в заданные сети идет напрямую, не попадая в tor или VPN, в режиме total-proxy TOTAL_PROXY_EXCLUDE_NETS=«10.0.0.0/8 172.16.0.0/12 192.168.0.0/16« ### Добавление в список блокировок пользовательских записей из файла $USER_ENTRIES_FILE (0 — off, 1 — on) ### В $DATA_DIR можно создать текстовый файл user_entries с записями ip, CIDR или FQDN (одна на строку). Эти записи будут добавлены в список блокировок ### В записях FQDN можно задать DNS-сервер для разрешения данного домена, через пробел (прим.: domain.com 8.8.8.8) ### Можно комментировать строки (#) ADD_USER_ENTRIES=1 ### DNS-сервер для пользовательских записей (пустая строка — без DNS-сервера). Можно с портом: 8.8.8.8#53. Если в записи указан свой DNS-сервер — он имеет приоритет export USER_ENTRIES_DNS=«« ### Входящий сетевой интерфейс для правил iptables IF_IN=«br0« ### WAN интерфейс IF_WAN=«ppp0« ### VPN интерфейс для правил iptables IF_VPN=«tun0« ### —set-mark для отбора пакетов в VPN туннель VPN_PKTS_MARK=1 ### Максимальное кол-во элементов списка ipset (по умол.: 65536, на данный момент уже не хватает для полного списка ip…) IPSET_MAXELEM=1000000 ### Удаление записей из основных сетов перед началом заполнения временных сетов при обновлении (для освобождения оперативной памяти перед заполнением сетов) (0 — off, 1 — on) IPSET_CLEAR_SETS=1 ### Таймаут для записей в сете $IPSET_DNSMASQ IPSET_DNSMASQ_TIMEOUT=3600 ### Кол-во попыток обновления блэклиста (в случае неудачи) MODULE_RUN_ATTEMPTS=3 ### Таймаут между попытками обновления MODULE_RUN_TIMEOUT=60 ############################ Configuration ############################# export PATH=«/opt/bin:/opt/sbin:/opt/usr/bin:/usr/sbin:/usr/bin:/sbin:/bin« export NAME=«ruantiblock« export LANG=«en_US.UTF-8« export LANGUAGE=«en« DATA_DIR=«/opt/var/${NAME}« ### Модули для получения и обработки блэклиста MODULES_DIR=«/opt/usr/bin« BLLIST_MODULE_CMD=«lua ${MODULES_DIR}/ruab_parser.lua« #BLLIST_MODULE_CMD=»python3 ${MODULES_DIR}/ruab_parser.py» #BLLIST_MODULE_CMD=»${MODULES_DIR}/ruab_parser.sh» #BLLIST_MODULE_CMD=»» CONFIG_FILE=«/opt/etc/${NAME}/${NAME}.conf« [ -f «$CONFIG_FILE« ] && . «$CONFIG_FILE« AWK_CMD=«awk« IPT_CMD=«iptables« IP_CMD=«ip« IPSET_CMD=`which ipset` if [ $? -ne 0 ]; then echo « Error! Ipset doesn’t exists« >&2 exit 1 fi LOGGER_CMD=`which logger` if [ $USE_LOGGER = «1« -a $? -ne 0 ]; then echo « Logger doesn’t exists« >&2 USE_LOGGER=0 fi LOGGER_PARAMS=«-t `basename $0`[${$}] -p user.notice« DNSMASQ_RESTART_CMD=«/sbin/restart_dhcpd; /sbin/restart_dns« export DNSMASQ_DATA_FILE=«${DATA_DIR}/${NAME}.dnsmasq« export IP_DATA_FILE=«${DATA_DIR}/${NAME}.ip« export IPSET_IP=«${NAME}-ip« export IPSET_IP_TMP=«${IPSET_IP}-tmp« export IPSET_CIDR=«${NAME}-cidr« export IPSET_CIDR_TMP=«${IPSET_CIDR}-tmp« export IPSET_DNSMASQ=«${NAME}-dnsmasq« export IPSET_ONION=«onion« export IPSET_TOTAL_PROXY=«total-proxy« export IPT_CHAIN=«$NAME« export UPDATE_STATUS_FILE=«${DATA_DIR}/update_status« UPDATE_PID_FILE=«${DATA_DIR}/update.pid« INIT_SCRIPT=«/opt/etc/init.d/S40${NAME}« HTML_DIR=«/opt/share/www/custom« export HTML_OUTPUT=«${HTML_DIR}/${NAME}.html« HTML_MAIN_BGCOLOR=«#DDDDDD« HTML_THEADER_FONTCOLOR=«#4C4C4C« HTML_BORDER_COLOR=«#B5B5B5« HTML_MAIN_FONT_COLOR=«#333333« ### Пользовательские записи USER_ENTRIES_FILE=«/opt/etc/${NAME}/ruab_user_entries« ########################### Iptables config ############################ IPT_FIRST_CHAIN=«PREROUTING« IPT_QUEUE_CHAIN=«$IPT_CHAIN« IPT_IPSET_MSET=«-m set —match-set« ### Проксификация трафика локальных клиентов IPT_OUTPUT_FIRST_RULE=«-j ${IPT_CHAIN}« WAN_IP=`$IP_CMD addr list dev $IF_WAN | $AWK_CMD /inet/{sub(«/[0-9]{1,2}$», «», $2); print $2}` VPN_NAT_RULE=«-m mark —mark ${VPN_PKTS_MARK} -s ${WAN_IP} -o ${IF_VPN} -j MASQUERADE« ### Tor конфигурация IPT_TABLE=«nat« IPT_FIRST_CHAIN_RULE=«-i ${IF_IN} -j ${IPT_CHAIN}« IPT_IPSET_TARGET=«dst -p tcp -j REDIRECT —to-ports ${TOR_TRANS_PORT}« #IPT_IPSET_TARGET=»dst -j REDIRECT —to-ports ${TOR_TRANS_PORT}» # весь трафик (не только TCP) IPT_IPSETS=«${IPSET_ONION} ${IPSET_CIDR} ${IPSET_IP} ${IPSET_DNSMASQ}« if [ «$PROXY_MODE« = «2« ]; then ### VPN конфигурация IPT_TABLE=«mangle« IPT_FIRST_CHAIN_RULE=«-j ${IPT_CHAIN}« IPT_IPSET_TARGET=«dst,src -j MARK —set-mark ${VPN_PKTS_MARK}« IPT_IPSETS=«${IPSET_CIDR} ${IPSET_IP} ${IPSET_DNSMASQ}« fi IPT_TP_RULE=«-m set ! —match-set ${IPSET_TOTAL_PROXY} ${IPT_IPSET_TARGET}« ############################## Functions ############################### Help () { cat << EOF Usage: `basename $0` start|stop|destroy|restart|update|force-update|data-files|total-proxy-on|total-proxy-off|renew-ipt|status|status-html|—help start : Start stop : Stop destroy : Stop + destroy ipsets and clear all data files restart : Restart update : Update blacklist force-update : Force update blacklist data-files : Create ${IP_DATA_FILE} & ${DNSMASQ_DATA_FILE} (without network functions) total-proxy-on : Turn on total-proxy mode total-proxy-off : Turn off total-proxy mode renew-ipt : Renew iptables configuration status : Status & some info html-info : Update html info page (if HTML_INFO=1) -h|—help : This message Examples: `basename $0` start `basename $0` stop `basename $0` destroy `basename $0` restart `basename $0` update `basename $0` force-update `basename $0` data-files `basename $0` total-proxy-on `basename $0` total-proxy-off `basename $0` status `basename $0` html-info EOF } MakeLogRecord () { [ $USE_LOGGER = «1« ] && $LOGGER_CMD $LOGGER_PARAMS $1 } DnsmasqRestart () { eval `echo «$DNSMASQ_RESTART_CMD«` } IsIpsetExists () { $IPSET_CMD list «$1« -terse &> /dev/null return $? } FlushIpSets () { local _set for _set in «$@« do IsIpsetExists «$_set« && $IPSET_CMD flush «$_set« done } DestroyIpsets () { local _set for _set in «$@« do IsIpsetExists «$_set« && $IPSET_CMD destroy «$_set« done } FillTotalProxySet () { local _entry for _entry in $TOTAL_PROXY_EXCLUDE_NETS do $IPSET_CMD add «$IPSET_TOTAL_PROXY« «$_entry« done } TotalProxyOn () { if [ «$PROXY_LOCAL_CLIENTS« != «1« ]; then $IPT_CMD -t «$IPT_TABLE« -I «$IPT_CHAIN« 1 $IPT_TP_RULE if [ $? -eq 0 ]; then echo « ${IPSET_TOTAL_PROXY} enabled« MakeLogRecord «${IPSET_TOTAL_PROXY} enabled« fi fi } TotalProxyOff () { if [ «$PROXY_LOCAL_CLIENTS« != «1« ]; then $IPT_CMD -t «$IPT_TABLE« -D «$IPT_CHAIN« $IPT_TP_RULE if [ $? -ne 0 ]; then echo « ${IPSET_TOTAL_PROXY} is already disabled« >&2 else echo « ${IPSET_TOTAL_PROXY} disabled« MakeLogRecord «${IPSET_TOTAL_PROXY} disabled« fi fi } AddIptRules () { local _set $IPT_CMD -t «$IPT_TABLE« -N «$IPT_CHAIN« $IPT_CMD -t «$IPT_TABLE« -I «$IPT_FIRST_CHAIN« 1 $IPT_FIRST_CHAIN_RULE if [ «$PROXY_LOCAL_CLIENTS« = «1« ]; then $IPT_CMD -t «$IPT_TABLE« -I OUTPUT 1 $IPT_OUTPUT_FIRST_RULE if [ «$PROXY_MODE« = «2« -a -n «$WAN_IP« ]; then $IPT_CMD -t nat -A POSTROUTING $VPN_NAT_RULE fi fi for _set in $IPT_IPSETS do $IPT_CMD -t «$IPT_TABLE« -A «$IPT_CHAIN« $IPT_IPSET_MSET «$_set« $IPT_IPSET_TARGET done if [ «$DEF_TOTAL_PROXY« = «1« ]; then TotalProxyOff &> /dev/null TotalProxyOn fi } RemIptRules () { $IPT_CMD -t «$IPT_TABLE« -F «$IPT_CHAIN« $IPT_CMD -t «$IPT_TABLE« -D «$IPT_FIRST_CHAIN« $IPT_FIRST_CHAIN_RULE if [ «$PROXY_LOCAL_CLIENTS« = «1« ]; then $IPT_CMD -t «$IPT_TABLE« -D OUTPUT $IPT_OUTPUT_FIRST_RULE if [ «$PROXY_MODE« = «2« -a -n «$WAN_IP« ]; then $IPT_CMD -t nat -D POSTROUTING $VPN_NAT_RULE fi fi $IPT_CMD -t «$IPT_TABLE« -X «$IPT_CHAIN« } SetNetConfig () { local _set for _set in «$IPSET_TOTAL_PROXY« «$IPSET_CIDR_TMP« «$IPSET_CIDR« do IsIpsetExists «$_set« || $IPSET_CMD create «$_set« hash:net maxelem $IPSET_MAXELEM done for _set in «$IPSET_IP_TMP« «$IPSET_IP« «$IPSET_ONION« do IsIpsetExists «$_set« || $IPSET_CMD create «$_set« hash:ip maxelem $IPSET_MAXELEM done IsIpsetExists «$IPSET_DNSMASQ« || $IPSET_CMD create «$IPSET_DNSMASQ« hash:ip maxelem $IPSET_MAXELEM timeout $IPSET_DNSMASQ_TIMEOUT FillTotalProxySet AddIptRules } DropNetConfig () { RemIptRules FlushIpSets «$IPSET_CIDR_TMP« «$IPSET_CIDR« «$IPSET_IP_TMP« «$IPSET_IP« «$IPSET_DNSMASQ« «$IPSET_ONION« «$IPSET_TOTAL_PROXY« } FillIpsets () { local _set if [ -f «$IP_DATA_FILE« ]; then echo « Filling ipsets…« FlushIpSets «$IPSET_IP_TMP« «$IPSET_CIDR_TMP« if [ «$IPSET_CLEAR_SETS« = «1« ]; then FlushIpSets «$IPSET_IP« «$IPSET_CIDR« fi IsIpsetExists «$IPSET_IP_TMP« && IsIpsetExists «$IPSET_CIDR_TMP« && IsIpsetExists «$IPSET_IP« && IsIpsetExists «$IPSET_CIDR« && cat «$IP_DATA_FILE« | $IPSET_CMD restore && { $IPSET_CMD swap «$IPSET_IP_TMP« «$IPSET_IP«; $IPSET_CMD swap «$IPSET_CIDR_TMP« «$IPSET_CIDR«; } if [ $? -eq 0 ]; then echo « Ok« FlushIpSets «$IPSET_IP_TMP« «$IPSET_CIDR_TMP« else echo « Error! Ipset wasn’t updated« >&2 MakeLogRecord «Error! Ipset wasn’t updated« fi fi } ClearDataFiles () { printf «« > «$DNSMASQ_DATA_FILE« printf «« > «$IP_DATA_FILE« printf «0 0 0« > «$UPDATE_STATUS_FILE« } CheckStatus () { local _set _ipt_return=0 _ipset_return=0 _return_code=1 $IPT_CMD -t «$IPT_TABLE« -L «$IPT_CHAIN« &> /dev/null _ipt_return=$? if [ «$1« = «ipsets« ]; then for _set in «$IPSET_TOTAL_PROXY« «$IPSET_CIDR_TMP« «$IPSET_CIDR« «$IPSET_IP_TMP« «$IPSET_IP« «$IPSET_DNSMASQ« «$IPSET_ONION« do IsIpsetExists «$_set« _ipset_return=$? [ $_ipset_return -ne 0 ] && break done fi [ $_ipt_return -eq 0 -a $_ipset_return -eq 0 ] && _return_code=0 return $_return_code } PreStartCheck () { [ -d «$DATA_DIR« ] || mkdir -p «$DATA_DIR« [ «$HTML_INFO« = «1« -a ! -d «$HTML_DIR« ] && mkdir -p «$HTML_DIR« [ -e «$DNSMASQ_DATA_FILE« ] || printf «n« > «$DNSMASQ_DATA_FILE« } AddUserEntries () { if [ «$ADD_USER_ENTRIES« = «1« ]; then if [ -f «$USER_ENTRIES_FILE« -a -s «$USER_ENTRIES_FILE« ]; then $AWK_CMD BEGIN { null=»»; while((getline ip_string <ENVIRON[«IP_DATA_FILE»]) > 0) { split(ip_string, ip_string_arr, » «); ip_data_array[ip_string_arr[3]]=null; }; close(ENVIRON[«IP_DATA_FILE»]); while((getline fqdn_string <ENVIRON[«DNSMASQ_DATA_FILE»]) > 0) { split(fqdn_string, fqdn_string_arr, «/»); fqdn_data_array[fqdn_string_arr[2]]=null; }; close(ENVIRON[«DNSMASQ_DATA_FILE»]); } function writeIpsetEntries(val, set) { printf «add %s %sn», set, val >> ENVIRON[«IP_DATA_FILE»]; }; function writeDNSData(val, dns) { if(length(dns) == 0 && length(ENVIRON[«USER_ENTRIES_DNS»]) > 0) dns = ENVIRON[«USER_ENTRIES_DNS»]; if(length(dns) > 0) printf «server=/%s/%sn», val, dns >> ENVIRON[«DNSMASQ_DATA_FILE»]; printf «ipset=/%s/%sn», val, ENVIRON[«IPSET_DNSMASQ»] >> ENVIRON[«DNSMASQ_DATA_FILE»]; }; ($0 !~ /^([4011]*$|#)/) { if($0 ~ /^[0-9]{1,3}([.][0-9]{1,3}){3}$/ && !($0 in ip_data_array)) writeIpsetEntries($0, ENVIRON[«IPSET_IP_TMP»]); else if($0 ~ /^[0-9]{1,3}([.][0-9]{1,3}){3}[57][0-9]{1,2}$/ && !($0 in ip_data_array)) writeIpsetEntries($0, ENVIRON[«IPSET_CIDR_TMP»]); else if($0 ~ /^[a-z0-9.52-]+[.]([a-z]{2,}|xn--[a-z0-9]+)([ ][0-9]{1,3}([.][0-9]{1,3}){3}([#][0-9]{2,5})?)?$/ && !($1 in fqdn_data_array)) writeDNSData($1, $2); } «$USER_ENTRIES_FILE« fi fi } GetDataFiles () { local _return_code=1 _attempt=1 _update_string PreStartCheck echo «$$« > «$UPDATE_PID_FILE« if [ -n «$BLLIST_MODULE_CMD« ]; then while : do eval `echo «$BLLIST_MODULE_CMD«` _return_code=$? [ $_return_code -eq 0 ] && break ### STDOUT echo « Module run attempt ${_attempt}: failed [${BLLIST_MODULE_CMD}]« MakeLogRecord «Module run attempt ${_attempt}: failed [${BLLIST_MODULE_CMD}]« _attempt=`expr $_attempt + 1` [ $_attempt -gt $MODULE_RUN_ATTEMPTS ] && break sleep $MODULE_RUN_TIMEOUT done AddUserEntries if [ $_return_code -eq 0 ]; then _update_string=`$AWK_CMD { printf «Received entries: %sn», (NF < 3) ? «No data» : «IP: «$1», CIDR: «$2», FQDN: «$3; exit; } «$UPDATE_STATUS_FILE«` ### STDOUT echo « ${_update_string}« MakeLogRecord «${_update_string}« printf « `date +%d.%m.%Y-%H:%M`n« >> «$UPDATE_STATUS_FILE« fi else ClearDataFiles AddUserEntries _return_code=0 fi if [ «$PROXY_MODE« = «2« ]; then printf «n« >> «$DNSMASQ_DATA_FILE« else printf «server=/onion/%snipset=/onion/%sn« «${ONION_DNS_ADDR}« «${IPSET_ONION}« >> «$DNSMASQ_DATA_FILE« fi rm -f «$UPDATE_PID_FILE« return $_return_code } Update () { local _return_code=0 if CheckStatus ipsets; then : else echo « ${NAME} ${1} — Error! ${NAME} does not running or another error has occurred« >&2 return 1 fi if [ -e «$UPDATE_PID_FILE« ] && [ «$1« != «force-update« ]; then echo « ${NAME} ${1} — Error! Another instance of update is already running« >&2 MakeLogRecord «${1} — Error! Another instance of update is already running« _return_code=2 else echo « ${NAME} ${1}« MakeLogRecord «${1}« GetDataFiles case $? in 0) echo « Blacklist updated« MakeLogRecord «Blacklist updated« FlushIpSets «$IPSET_DNSMASQ« FillIpsets DnsmasqRestart ;; 2) echo « Error! Blacklist update error« >&2 MakeLogRecord «Error! Blacklist update error« _return_code=1 ;; *) echo « Module error! [${BLLIST_MODULE_CMD}]« >&2 MakeLogRecord «Module error! [${BLLIST_MODULE_CMD}]« _return_code=1 ;; esac fi return $_return_code } Start () { echo « ${NAME} ${1}« MakeLogRecord «${1}« DropNetConfig &> /dev/null SetNetConfig PreStartCheck FillIpsets } Stop () { echo « ${NAME} ${1}« MakeLogRecord «${1}« DropNetConfig &> /dev/null } RenewIpt () { if [ -x «$INIT_SCRIPT« ]; then RemIptRules &> /dev/null AddIptRules &> /dev/null fi } Status () { local _set local _call_iptables=«${IPT_CMD} -t ${IPT_TABLE} -v -L ${IPT_CHAIN}« if CheckStatus; then printf «n 33[1m${NAME} status33[m: 33[1;32mActive33[mnn PROXY_MODE: ${PROXY_MODE}n DEF_TOTAL_PROXY: ${DEF_TOTAL_PROXY}n PROXY_LOCAL_CLIENTS: ${PROXY_LOCAL_CLIENTS}n BLLIST_MODULE_CMD: ${BLLIST_MODULE_CMD}n« if [ -f «$UPDATE_STATUS_FILE« ]; then $AWK_CMD { update_string=(NF < 4) ? «No data» : $4″ (ip: «$1» | CIDR: «$2» | FQDN: «$3″)»; printf «n Last blacklist update: %sn», update_string; } «$UPDATE_STATUS_FILE« else printf «n Last blacklist update: No datan« fi printf «n 33[4mIptables rules33[m:nn« $_call_iptables | $AWK_CMD { if(NR > 2) { match_set=(NR == 3 && $0 ~ ENVIRON[«IPSET_TOTAL_PROXY»]) ? «33[1;31m»ENVIRON[«IPSET_TOTAL_PROXY»]» (Enabled!)33[m» : $11; match_set_html=(NR == 3 && $0 ~ ENVIRON[«IPSET_TOTAL_PROXY»]) ? ENVIRON[«IPSET_TOTAL_PROXY»]» (Enabled!)» : $11; match_set_html_class=(NR == 3 && $0 ~ ENVIRON[«IPSET_TOTAL_PROXY»]) ? » red» : «»; printf » Match-set: %sn Bytes: %snn», match_set, $2; }; } printf « 33[4mIp sets33[m:nn« for _set in «$IPSET_TOTAL_PROXY« «$IPSET_CIDR_TMP« «$IPSET_CIDR« «$IPSET_IP_TMP« «$IPSET_IP« «$IPSET_DNSMASQ« «$IPSET_ONION« do $IPSET_CMD list «$_set« -terse | $AWK_CMD -F «:« { if($1 ~ /^(Name|Size in memory|Number of entries)/) { printf » %s: %sn», $1, $2; if($1 ~ /^Number of entries/) printf «n»; }; } done else printf «n 33[1m${NAME} status33[m: 33[1mOff33[mnn« exit 2 fi } HtmlInfo () { local _set local _call_iptables=«${IPT_CMD} -t ${IPT_TABLE} -v -L ${IPT_CHAIN}« if [ «$HTML_INFO« = «1« -a -d «$HTML_DIR« ]; then cat << EOF > $HTML_OUTPUT <!DOCTYPE html PUBLIC «-//W3C//DTD XHTML 1.0 Strict//EN» «http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd»> <html xmlns=»http://www.w3.org/1999/xhtml»><head> <meta http-equiv=»Content-Type» content=»text/html; charset=utf-8″ /> <title>${NAME} status</title> <style type=»text/css»> body { margin: 0px; padding: 0px; background-color: ${HTML_MAIN_BGCOLOR}; font-family: sans-serif; font-size: 11pt; font-weight: 400; color: ${HTML_MAIN_FONT_COLOR} } #main_layout { width: 100%; min-width: 760px } div.main { position: relative; width: 100%; text-align: center; padding: 10px 0px 10px 0px; font-size: 10pt; color: ${HTML_THEADER_FONTCOLOR}; border: 0px; } table.info_table { width: 700px; border-collapse: collapse; margin: auto } tr.infoarea > td { padding: 5px; font-size: 10pt; color: ${HTML_THEADER_FONTCOLOR}; border-top: 0px; border-bottom: 1px solid ${HTML_BORDER_COLOR}; border-left: 0px; border-right: 0px } tr.list > td { width: 50%; padding: 5px 2px 5px 2px; border-top: 1px solid ${HTML_BORDER_COLOR}; border-bottom: 1px solid ${HTML_BORDER_COLOR}; border-left: 0px; border-right: 0px } span.info_label { display: block; padding: 0px 0px 10px 0px } .green { background-color: #E4FFE4 } .red { background-color: #FFD6D6 } </style> </head><body> <div id=»main_layout»> EOF if CheckStatus; then printf «<div class=«main«><table class=«info_table«>n <tr class=«list«><td align=«left«>Last status update at:</td><td align=«left«>`date`</td></tr>n <tr class=«list green«><td align=«left«>${NAME} status:</td><td align=«left«>Active</td></tr>n <tr class=«list«><td align=«left«>PROXY_MODE:</td><td align=«left«>${PROXY_MODE}</td></tr>n <tr class=«list«><td align=«left«>DEF_TOTAL_PROXY:</td><td align=«left«>${DEF_TOTAL_PROXY}</td></tr>n <tr class=«list«><td align=«left«>PROXY_LOCAL_CLIENTS:</td><td align=«left«>${PROXY_LOCAL_CLIENTS}</td></tr>n <tr class=«list«><td align=«left«>BLLIST_MODULE_CMD:</td><td align=«left«>${BLLIST_MODULE_CMD}</td></tr>n« >> «$HTML_OUTPUT« if [ -f «$UPDATE_STATUS_FILE« ]; then $AWK_CMD { update_string=(NF < 4) ? «No data» : $4″ (ip: «$1» | CIDR: «$2» | FQDN: «$3″)»; printf «<tr class=»list»><td align=»left»>Last blacklist update:</td><td align=»left»>%s</td></tr>n», update_string; } «$UPDATE_STATUS_FILE« >> «$HTML_OUTPUT« else printf «<tr class=«list«><td align=«left«>Last blacklist update:</td><td align=«left«>No data</td></tr>n« >> «$HTML_OUTPUT« fi printf «</table></div><div class=«main«><span class=«info_label«>Iptables rules:</span>« >> «$HTML_OUTPUT« $_call_iptables | $AWK_CMD BEGIN { printf «%s», «<table class=»info_table»><tr class=»infoarea»><td align=»left» width=»50%»>Match-set</td><td align=»center»>Bytes</td></tr>»; } { if(NR > 2) { match_set=(NR == 3 && $0 ~ ENVIRON[«IPSET_TOTAL_PROXY»]) ? «33[1;31m»ENVIRON[«IPSET_TOTAL_PROXY»]» (Enabled!)33[m» : $11; match_set_html=(NR == 3 && $0 ~ ENVIRON[«IPSET_TOTAL_PROXY»]) ? ENVIRON[«IPSET_TOTAL_PROXY»]» (Enabled!)» : $11; match_set_html_class=(NR == 3 && $0 ~ ENVIRON[«IPSET_TOTAL_PROXY»]) ? » red» : «»; printf «<tr class=»infoarea%s»><td align=»left»>%s</td><td align=»center»>%s</td></tr>n», match_set_html_class, match_set_html, $2; }; } END { printf «%s», «</table></div>»; } >> «$HTML_OUTPUT« printf «%s« «<div class=«main«><span class=«info_label«>Ip sets:</span> <table class=«info_table«> <tr class=«infoarea«><td align=«left« width=«33%«>Name</td><td align=«center« width=«33%«>Size in memory</td><td align=«center«>Number of entries</td></tr>« >> «$HTML_OUTPUT« for _set in «$IPSET_TOTAL_PROXY« «$IPSET_CIDR_TMP« «$IPSET_CIDR« «$IPSET_IP_TMP« «$IPSET_IP« «$IPSET_DNSMASQ« «$IPSET_ONION« do $IPSET_CMD list «$_set« -terse | $AWK_CMD -F «:« BEGIN { printf «%s», «<tr class=»infoarea»>»; } { if($1 ~ /^(Name|Size in memory|Number of entries)/) { align=($1 ~ /^Name/) ? «left» : «center»; printf «<td align=»%s»>%s</td>n», align, $2; }; } END { printf «%s», «</tr>»; } >> «$HTML_OUTPUT« done printf «</table></div>« >> «$HTML_OUTPUT« else printf «<div class=«main«><table class=«info_table«><tr class=«list«><td align=«left«>${NAME} status:</td><td align=«left«>Off</td></tr></table></div>n« >> «$HTML_OUTPUT« fi printf «</div></body></html>n« >> «$HTML_OUTPUT« fi } ############################# Run section ############################## case «$1« in start|restart) Start «$1« HtmlInfo ;; stop) Stop «$1« HtmlInfo ;; destroy) Stop «$1« DestroyIpsets «$IPSET_TOTAL_PROXY« «$IPSET_CIDR_TMP« «$IPSET_CIDR« «$IPSET_IP_TMP« «$IPSET_IP« «$IPSET_DNSMASQ« «$IPSET_ONION« ClearDataFiles rm -f «$UPDATE_PID_FILE« DnsmasqRestart HtmlInfo ;; renew-ipt) RenewIpt HtmlInfo ;; update|force-update) Update «$1« HtmlInfo ;; data-files) if [ -e «$UPDATE_PID_FILE« ] && [ «$1« != «force-update« ]; then echo « ${NAME} — Error! Another instance of update is already running« >&2 exit 2 else GetDataFiles fi ;; total-proxy-on) TotalProxyOff &> /dev/null TotalProxyOn HtmlInfo ;; total-proxy-off) TotalProxyOff HtmlInfo ;; status) Status ;; html-info) HtmlInfo ;; -h|—help|help) Help ;; *) Help exit 1 ;; esac exit 0;

This is a quick solution to solve the error “Another instance of Certbot is already running”. This error is usually encountered when you attempt to create a new or to renew an SSL certificate on your Linux systems such as Ubuntu, CentOS, Debian, Fedora, or other common server distros.

This message can be posted when you try to run Let’s Encrypt Certbot. The cause could step from any situation that causes one to end up back on the terminal’s command prompt while there is an active instance of Certbot running.

Seeing that Let’s Encrypt Certbot can only have one instance running at a time, you would need to kill the current instance before trying to invoke another one.

How to Fix “Another Instance of Certbot is Already Running”

Kill the Let’s Encrypt Certbot process by doing either of the following:

a) Reboot Your Linux System

This solution may not be practical on a live server so here is a better option:

b) Kill the Certbot Process

Find the Certbot process using the following command:

$ ps -ef | grep certbot

Output
brightwhiz      368020  367989  0 09:27 pts/1    00:00:00 sudo certbot --apache certonly
brightwhiz      368023  368020 11 09:27 pts/1    00:00:03 /usr/bin/python3 /usr/bin/certbot --apache certonly

The process ID is the first number after the user. In the above example that would be (368020 and 368023)

Kill the process(es) using this:

$ sudo kill 368020

Replacing 368020 with your actual process ID.

Run the Certbot command again and you should be able to use it as expected.

What if the Above Fails

In cases where your server may have rebooted unexpectedly during the renewal process, it could be that Certbot is not running but it left some .certbot.lock files behind. Let’s see if they exist and if they do, we remove the lock files.

Check whether there are .certbot.lock files in your system using this command:

$ find / -type f -name ".certbot.lock"

If there are, you can remove them using this command:

$ sudo find / -type f -name ".certbot.lock" -exec rm {} ;

Conclusion

These are the sure methods you can use to fix the “Another instance of Certbot is already running” error message you get when you try to renew an SSL using Let’s Encrypt Certbot on your Linux systems such as Ubuntu or CentOS.

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.

Запуская какую-либо программу (обычно игровую) пользователь может столкнуться с отказом программы от запуска, что сопровождается сообщением «Another instance is already running». Обычно это означает, что такая же программа уже была запущена ранее, и пользователь пытается запустить её вновь. В нашем материале мы разберём, что это за ошибка, какими причинами она вызвана, и как её можно исправить.

Ошибка another instance

Содержание

  1. Another instance is already running – что это означает?
  2. Удалите процесс из Диспетчера задач
  3. Перезагрузите ваш ПК
  4. Удалите Ad-Aware Web Companion
  5. Обновите вашу ОС
  6. Заключение

Another instance is already running – что это означает?

В переводе текст данного уведомления выглядит как «Другой образец уже запущен». Это означает, что процесс данной программы был уже ранее запущен пользователем или системой, и работает в фоне вашей ОС. При запуске вами данной программы её новый процесс обнаруживает уже работающий идентичный процесс в фоне, и автоматически закрывается, поскольку не настроен на параллельную работу двух одинаковых процессов. Впрочем, для некоторых программ бывают и исключения.

Также другими причинами появления сообщения «Another instance is already running» могут быть следующие:

  • Другая версия данной программы ранее была установлена на компьютер. В некоторых случаях такая программа стартует с запуском ПК и работает в фоне;
  • Инсталляция данной программы была выполнена некорректно, и её процесс остался работать в фоне;
  • На вашем ПК установлена программа «Ad-Aware Web Companion». Данный софт является частым фактором появления сообщения «Another instance is already running»;
  • Также причиной ошибки в редких случаях может выступать устаревшая версия Виндовс;
  • В редких случаях причиной может выступать приложение «lolpatcher» при запуске игры «League of Legends».

Давайте разберём, как исправить ошибку «Another instance is already running».

Ошибка

Удалите процесс из Диспетчера задач

Первым и наиболее эффективным способом устранить ошибку «Another instance is already running» — это удаление процесса программы, которую вы запускаете, из Диспетчера задач. Выполните следующие действия:

  1. Нажмите на сочетание клавиш Ctrl+Shift+Escape;
  2. В открывшемся Диспетчере задач во вкладке «Процессы» найдите процесс, имя которого совпадает с именем запускаемой вами программы, во время работы которой вы получаете рассматриваемую ошибку;
  3. Кликните на данный процесс, после чего нажмите внизу на кнопку «Снять задачу»; Кнопка
  4. Выполните данную процедуру для всех процессов, с именем запускаемой вами программы;
  5. Затем попробуйте запустить нужную программу. В большинстве случаев она запустится без каких-либо проблем.

Перезагрузите ваш ПК

Довольно простым и эффективным способом борьбы с ошибкой «Another instance is already running» является перезагрузка вашего ПК. Перезагрузите ваш компьютер стандартным образом, и рассматриваемая нами ошибка может пропасть.

Перезагрузка ПК

Как упоминалось выше, часто встречающимся источником проблемы является приложение «Ad-Aware Web Companion», поставляемая с антишпионским инструментом «Ad-Aware». Удаление данного софта должно решить данную проблему.

Выполните следующие действия:

  1. Нажмите на Win+R;
  2. В появившейся табличке введите команду appwiz.cpl и нажмите ввод;
  3. Найдите в перечне программ «Web Companion», кликните на него и удалите программу с вашего ПК.

Обновите вашу ОС

Также сообщение «Another instance is already running» может возникнуть в случае, если версия вашей ОС Виндовс устарела. Обновление вашей ОС до последней версии может устранить возникшую проблему. Выполните следующее:

  1. Нажмите на сочетание клавиш Win+R;
  2. Введите там команду ms-settings:windowsupdate и нажмите на клавишу Энтер; Команда
  3. Запустится Центр обновления Виндовс;
  4. Нажмите там на кнопку проверки наличия обновлений;Кнопка проверки обновлений
  5. ОС Виндовс проверит, есть ли какие-либо обновления, ожидающие установки. При наличии таковых установите их в системе. После этого рассматриваемая нами ошибка может пропасть.

Это полезно знать: Произошла ошибка. Перезапустите игру, чтобы использовать эту возможность в КС:ГО.

Заключение

В нашем материале мы разобрали, что за ошибка «Another instance is already running», какими причинами она вызвана, и как исправить возникшую проблему. Обычно фактором ошибки выступает процесс запускаемой программы, работающий в фоновом режиме операционной системы. Достаточно удалить данный процесс в Диспетчере задач, после чего указанное сообщение перестанет вам досаждать.

Опубликовано 16.03.2022 Обновлено 16.03.2022

I’ve written before about Certbot and how wonderful it is. Recently I’ve come across a situation where certbot renewals aren’t going thru:

root@host:~# certbot renew --force-renewal
Another instance of Certbot is already running.

root@host:~# ps waux | grep certbot
root     20947  0.0  0.0   4500   744 ?        Ss   16:52   0:00 /bin/sh -c /usr/local/sbin/certbot-renew.sh
root     20949  0.0  0.0   4500   736 ?        S    16:52   0:00 /bin/sh /usr/local/sbin/certbot-renew.sh
root     20953  0.3  4.4 148704 45440 ?        S    16:52   0:00 /usr/bin/python3 /usr/bin/certbot renew --post-hook touch /var/lib/letsencrypt/updated
root     21049  0.0  0.0  12940  1012 pts/4    S+   16:54   0:00 grep --color=auto certbot

root@host:~# certbot --version
certbot 0.31.0

If I check the logfile /var/log/letsencrypt/letsencrypt.log I can see that it keeps on trying and trying to do renewals.

grep "random delay" /var/log/letsencrypt/letsencrypt.log

2020-04-14 16:16:02,526:INFO:certbot.renewal:Non-interactive renewal: random delay of 5 seconds
2020-04-14 16:17:02,135:INFO:certbot.renewal:Non-interactive renewal: random delay of 409 seconds
2020-04-14 16:24:01,684:INFO:certbot.renewal:Non-interactive renewal: random delay of 290 seconds
2020-04-14 16:29:01,744:INFO:certbot.renewal:Non-interactive renewal: random delay of 190 seconds
2020-04-14 16:33:02,261:INFO:certbot.renewal:Non-interactive renewal: random delay of 283 seconds
2020-04-14 16:38:01,813:INFO:certbot.renewal:Non-interactive renewal: random delay of 350 seconds
2020-04-14 16:44:01,613:INFO:certbot.renewal:Non-interactive renewal: random delay of 117 seconds
2020-04-14 16:46:02,187:INFO:certbot.renewal:Non-interactive renewal: random delay of 309 seconds
2020-04-14 16:52:01,834:INFO:certbot.renewal:Non-interactive renewal: random delay of 453 seconds

Here’s what I do next:

  1. find any running certbot processes.
  2. kill them (with -9) one by one
  3. find and lock files
  4. remove them
root@host:~# ps waux | grep cert
root     20947  0.0  0.0   4500   744 ?        Ss   16:52   0:00 /bin/sh -c /usr/local/sbin/certbot-renew.sh
root     20949  0.0  0.0   4500   736 ?        S    16:52   0:00 /bin/sh /usr/local/sbin/certbot-renew.sh
root     20953  0.1  4.4 148704 45440 ?        S    16:52   0:00 /usr/bin/python3 /usr/bin/certbot renew --post-hook touch /var/lib/letsencrypt/updated
root     21152  0.0  0.0  12940   936 pts/4    S+   16:57   0:00 grep --color=auto cert

root@host:~# kill -9 20947
root@host:~# kill -9 20949
root@host:~# kill -9 20953
root@host:~# find / -type f -name ".certbot.lock"
/var/lib/letsencrypt/.certbot.lock
/var/log/letsencrypt/.certbot.lock
/etc/letsencrypt/.certbot.lock

root@host:~# rm /var/lib/letsencrypt/.certbot.lock  /var/log/letsencrypt/.certbot.lock /etc/letsencrypt/.certbot.lock

Next, I want to uninstall it.

root@host:~# apt list --installed | grep certbot

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

certbot/xenial,now 0.31.0-1+ubuntu16.04.1+certbot+1 all [installed]
python3-acme/xenial,now 0.31.0-2+ubuntu16.04.6+certbot+2 all [installed,automatic]
python3-asn1crypto/xenial,now 0.22.0-2+ubuntu16.04.1+certbot+1 all [installed,automatic]

Next, I want to uninstall it:

root@host:~#  apt-get remove certbot
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  python3-acme python3-certbot python3-configargparse python3-funcsigs python3-future python3-icu python3-josepy
  python3-mock python3-parsedatetime python3-pbr python3-requests-toolbelt python3-rfc3339 python3-tz
  python3-zope.component python3-zope.event python3-zope.hookable python3-zope.interface
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  certbot
0 upgraded, 0 newly installed, 1 to remove and 9 not upgraded.
After this operation, 39.9 kB disk space will be freed.
Do you want to continue? [Y/n]

Type in Y to continue, then after that, get rid of code you no longer need

root@mhs02:~#  apt-get remove certbot
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  python3-acme python3-certbot python3-configargparse python3-funcsigs python3-future python3-icu python3-josepy
  python3-mock python3-parsedatetime python3-pbr python3-requests-toolbelt python3-rfc3339 python3-tz
  python3-zope.component python3-zope.event python3-zope.hookable python3-zope.interface
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  certbot
0 upgraded, 0 newly installed, 1 to remove and 9 not upgraded.
After this operation, 39.9 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 158315 files and directories currently installed.)
Removing certbot (0.31.0-1+ubuntu16.04.1+certbot+1) ...
Processing triggers for man-db (2.7.5-1) ...
root@host:~# apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  python3-acme python3-certbot python3-configargparse python3-funcsigs python3-future python3-icu python3-josepy
  python3-mock python3-parsedatetime python3-pbr python3-requests-toolbelt python3-rfc3339 python3-tz
  python3-zope.component python3-zope.event python3-zope.hookable python3-zope.interface
0 upgraded, 0 newly installed, 17 to remove and 9 not upgraded.
After this operation, 6,352 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 158306 files and directories currently installed.)
Removing python3-certbot (0.31.0-1+ubuntu16.04.1+certbot+1) ...
Removing python3-acme (0.31.0-2+ubuntu16.04.6+certbot+2) ...
Removing python3-configargparse (0.11.0-1+certbot~xenial+1) ...
Removing python3-mock (1.3.0-2.1ubuntu1) ...
Removing python3-funcsigs (0.4-2) ...
Removing python3-parsedatetime (2.4-3+ubuntu16.04.1+certbot+3) ...
Removing python3-future (0.15.2-4+ubuntu16.04.1+certbot+3) ...
Removing python3-icu (1.9.2-2build1) ...
Removing python3-josepy (1.1.0-2+ubuntu16.04.1+certbot+1) ...
Removing python3-pbr (1.8.0-4ubuntu1) ...
Removing python3-requests-toolbelt (0.8.0-1+ubuntu16.04.1+certbot+1) ...
Removing python3-rfc3339 (1.0-4+certbot~xenial+1) ...
Removing python3-tz (2014.10~dfsg1-0ubuntu2) ...
Removing python3-zope.component (4.3.0-1+ubuntu16.04.1+certbot+3) ...
Removing python3-zope.event (4.2.0-1) ...
Removing python3-zope.hookable (4.0.4-4+ubuntu16.04.1+certbot+1) ...
Removing python3-zope.interface (4.3.2-1+ubuntu16.04.1+certbot+1) ...

Check to see if that removed the process

root@host:~# ps waux | grep cert
root     21304  0.0  0.0   4500   748 ?        Ss   17:01   0:00 /bin/sh -c /usr/local/sbin/certbot-renew.sh
root     21306  0.0  0.0   4500   776 ?        S    17:01   0:00 /bin/sh /usr/local/sbin/certbot-renew.sh
root     21310  0.2  4.7 157436 48228 ?        S    17:01   0:00 /usr/bin/python3 /usr/bin/certbot renew --post-hook touch /var/lib/letsencrypt/updated
root     22017  0.0  0.1  12940  1092 pts/4    S+   17:08   0:00 grep --color=auto cert
root@host:~# ls /usr/local/sbin
certbot-renew.sh

root@host:~#  mv /usr/local/sbin/certbot-renew.sh   /usr/local/sbin/certbot-renew.sh.hide

Triple check nothings running

root@mhs02:~# ps waux | grep cert
root     22118  0.0  0.1  12940  1020 pts/4    S+   17:09   0:00 grep --color=auto cert

Follow the instructions at:
https://certbot.eff.org/instructions on how to install certbot for your installation.

sudo apt-get install certbot python-certbot-apache

Finally, let’s check the server uptime, check the expiration date of a site running on this server, gracefully restart apache, then check the expiration date again:

root@host:~# apachectl status | grep uptime
   Server uptime: 11 days 22 hours 45 minutes 34 seconds

root@host:~# echo | openssl s_client -servername www.example.org -connect www.example.org:443 2>/dev/null | openssl x509 -noout -dates
notBefore=Mar  3 16:27:55 2020 GMT
notAfter=Jun  1 16:27:55 2020 GMT

root@host:~# apachectl graceful
[Tue Apr 14 17:17:24.937566 2020] [so:warn] [pid 26644] AH01574: module security2_module is already loaded, skipping

root@host:~# apachectl status | egrep 'uptime|Restart'
   Restart Time: Thursday, 02-Apr-2020 18:29:10 UTC
   Server uptime: 11 days 22 hours 52 minutes 3 seconds


root@host:~# echo | openssl s_client -servername www.example.org -connect www.example.org:443 2>/dev/null | openssl x509 -noout -dates
notBefore=Apr 14 16:13:15 2020 GMT
notAfter=Jul 13 16:13:15 2020 GMT

Success! We can see that the new renewal dates are in place.

To make sure that renewals happen automatically, I like to have this crontab in place:

# Let's keep let's encrypt ssl certs up to date.
31 3,15 * * * /usr/bin/certbot renew --quiet

While using your computer you may have come across Another instance is running error, which appears sometimes when you trying to open certain files, applications or games.

another_instance_is_running_error

This error can also appear as another instance is running configuration system failed to initialize or another instance of this application is already running. This error can be very annoying, which is why in this article we have discussed the various ways one can diagnose and troubleshoot this problem.

What Is Causing The “Another Instance Is Running Error”?

Contents

  • 1 What Is Causing The “Another Instance Is Running Error”?
  • 2 Fixing The Another Instance Is Running Error
    • 2.1 Solution 1: Uninstall Ad-Aware Web Companion
    • 2.2 Solution 2: Update Windows
    • 2.3 Solution 3: Close Down Background Processes
    • 2.4 Solution 4: Change The Properties Of The Workstation Service
    • 2.5 Solution 5: Create A New User Account For Windows 10
    • 2.6 Solution 6: Troubleshooting This Error For The League Of Legends Game
    • 2.7 Solution 6.1: Close Down All Lolpatcher Processes In The Background
    • 2.8 Solution 6.2: Use Netsh Winsock Reset Command
    • 2.9 Solution 6.3: Run LOL As Administrator
  • 3 Wrapping Up

There can be various different causes of this error. Now, let’s take a look at those causes:

  • The most common cause of this error is the Ad-Aware Web Companion. For most of the users affected by this error, this app was the culprit.
  • Outdated Windows can cause several problems for your computer including this error.
  • If the processes of the file that are instigating this error, is already running in the background while you try to open it again, then this error can get triggered.
  • If this error occurs while installing Adobe product updates, then most likely it is caused by improper Workstation Service settings.
  • The lolpatcher application is generally the culprit for this error if the error gets triggered when you try to open the League of Legends (LOL) game.

Now that you have seen the various different causes of this error, it’s time to troubleshoot them one by one. Read and execute the following solutions carefully.

Solution 1: Uninstall Ad-Aware Web Companion

As mentioned above, the most common instigator of this problem is the Web companion that comes with the Ad-Aware anti-spyware tool. If Ad-Aware anti-spyware tool is also installed on your computer, then you probably have found the culprit.

In this scenario, uninstalling the Web companion from your computer should fix this problem.

To uninstall Web companion, follow the steps given below:

  1. Type Apps & features in the Windows search bar and select the appropriate option.
  2. Now, scroll down and locate the Web Companion application and click on it.
  3. Click on the Uninstall option to uninstall the Web companion from your PC.

Uninstall_web_companion

If you can’t find the Web Companion software among the other apps then, you will have to remove the Ad-Aware directly from your computer.

To remove Ad-Aware directly from your computer, follow the steps given below:

  1. Press the Windows + R keys to open the Run dialogue.
  2. Type appwiz.cpl and press Enter.
    It will open the Programs and Features panel.

Run_appwiz_cpl

  1. Locate the Ad-Aware SE file and right-click on it.
  2. Click on the Uninstall option from the pop-up menu. Follow the instructions on your screen and wait for the uninstallation to finish.

By uninstalling the Web companion and Ad-Aware another instance of this application is already running error should be fixed. However, if the error persists, then try the other solutions given below.

Solution 2: Update Windows

This error can also occur if the Windows is outdated. For many users, updating Windows to the latest version fixed this error. Check if you have any updates pending, if yes then update them.

To update your Windows, follow the steps given below:

  1. Type Check for updates in the Windows search bar and select the appropriate option.
  2. Click on the Check for updates option.Now, Windows will check if there is any update pending and then update it automatically.

Check_for_Windows_update

Once the update is finished, restart your computer. Now, check if the error has resolved.

Solution 3: Close Down Background Processes

Sometimes, this error can be triggered while opening/installing apps if the processes of the app are already running in the background. In this scenario, closing down the background processes of the problematic app should fix this error.

To close down the background processes of the problematic app, follow the steps given below:

  1. Right-click on the Taskbar and click on the Task Manager option.
  2. Under the Processes tab locate the processes of the problematic app and right-click on it.
  3. Click on the End Task option on the pop-up menu.

Once, you have closed down all the processes running in the background of the app causing this problem, check if the Another instance is running error has resolved.

Solution 4: Change The Properties Of The Workstation Service

If you are facing this error while installing Adobe product updates, then the improper setting in the Workstation service is probably causing this error.

In this scenario, changing the startup type and starting the service manually should solve this error. To change the startup type of the Workstation service, follow the steps given below:

  1. Type Services in the Windows search bar and click on the appropriate option.
  2. Locate the Workstation service and right-click on it. Click on the Properties option to open the properties of the Workstation service.
  3. Change the Startup Type to Automatic and if the service is not shown as running, then click on the Start option to start it manually.
  4. Click OK to save the changes made.

Workstation_service_Startup_type

Try to install the Adobe product updates again and see if the error has resolved.

Solution 5: Create A New User Account For Windows 10

If none of the above solutions has worked, then you can try creating a new Windows 10 user account. To create a new user account in Windows 10, follow the steps given below:

  1. Type Settings in the Windows search bar and select the appropriate option.
  2. Click on the Accounts option and then select the Family & other users section.
  3. Under the Other Users, click on the Add someone else to this PC option.

New_user_account_sign_in

  1. Now, on the Microsoft account page, click on the I don’t have this person’s sign-in information option.
  2. Click on the Add a user without a Microsoft account option.

Add_user_without_Microsoft_account

  1. Finally, fill in the name and the password of your new account and then click on the Next option.

Once the new account is created, sign out from your current account and login on to your new account. Check if the error persists. If the error has been resolved, then you should probably only use this account. Remember this solution is only just a work-around, you will probably face the error again if you log in to your old account.

If you are facing the “Another instance is running configuration system failed to initialize” error while opening the League Of Legends (LOL) game, then you can try the following solutions.

Solution 6.1: Close Down All Lolpatcher Processes In The Background

Many users who have faced the “another instance of this application is already running” error while using LOL have reported that the lolpatcher application opening at the same time with the LOL was causing it.

In this scenario, closing all the background processes of lolpatcher before opening LOL should fix this problem.

To close down all the lolpatcher background processes, follow the steps given below:

  1. Press the Ctrl + Shift + Esc keys on your desktop. This will open up the Task Manager on your screen.
  2. Locate the lolpatcher process in the Processes tab and right-click on it.
  3. Finally, click on the End Task option and then close down the Task Manager.

Now, check if another instance of this application is already running error persists.

Solution 6.2: Use Netsh Winsock Reset Command

Some users have reported that for LOL, this error can be fixed by simply running the winsock reset command in an elevated Command Prompt.

To open an elevated Command prompt and run the winsock reset command, follow the steps given below:

  1. Press the Windows + R keys to open the Run
  2. Type cmd and while holding the Ctrl + Shift keys click on OK. Now, an elevated Command prompt will open on your screen.
  3. Type netsh winsock reset and press Enter.

Netsh_winsock_reset

Now, check if another instance is running configuration system failed to initialize error persists. This solution should solve this error in LoL.

Solution 6.3: Run LOL As Administrator

If none of the above solutions worked for fixing this error for LOL, try running LOL as administrator. To open LOL as an administrator, follow the steps given below:

  1. Right-click on the LOL shortcut on your desktop.
  2. Then, click on the Run as administrator option in the pop-up menu.
  3. Click on the Yes option on the pop-up dialog box. Now, LOL should open as an administrator.

Wrapping Up

So, now you know what to do if you ever face the Another instance is running error. The above solutions should help you solve this error so read and execute them carefully. As always, feel free to share your thoughts on this article in the comment section below.

by Milan Stanojevic

Milan has been enthusiastic about technology ever since his childhood days, and this led him to take interest in all PC-related technologies. He’s a PC enthusiast and he… read more


Updated on January 26, 2023

  • Users have reported receiving the another instance is already running error on their computers.
  • For some users, this issue appears when starting certain software, but it can also come up in specific apps such as League of Legends.
  • Read on to find out how to fix this issue on your PC and restore its proper functionality.

Another instance is running error

XINSTALL BY CLICKING THE DOWNLOAD FILE

To fix various PC problems, we recommend Restoro PC Repair Tool:
This software will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Fix PC issues and remove viruses now in 3 easy steps:

  1. Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues affecting your computer’s security and performance
  • Restoro has been downloaded by 0 readers this month.

Computer errors will occur sooner or later, and while some computer errors are relatively harmless, others can prevent you from starting your applications.

One of these errors is Another instance is running error, and today we’ll show you how to fix it on Windows 10 & Windows 11.

How to fix the Another instance is running error?

According to users, this issue occurs every time Windows 10 starts, and it seems that the culprit is Ad-Aware. This is a solid anti-spyware tool, but like many other security tools it comes with Web Companion.

Users reported that Web Companion causes Another instance is running error to appear, and the only way to fix this problem is to uninstall the application.

To do that, follow these simple steps:

  1. Press Windows Key + I to open the Settings app.
  2. Go to System section and then choose Apps & features.
  3. List of all installed applications will appear. Select Web Companion app and click the Uninstall button to remove it. If you can’t find this application, you might have to remove Ad-Aware in order to fix the problem.

Users reported that removing Ad-Aware Web Companion fixes the problem, but we have to mention that almost any other tool can cause this error to appear.

If the issue still persists, or if you don’t use Ad-Aware at all, you might have to find the problematic application on your own and remove it.


2. Create a new user account

As we previously mentioned, almost any application can cause Another instance is running error to appear.

If you can’t find the problematic application, you might want to try creating a new Windows 10 user account.

To do that, you need to follow these simple steps:

  1. Open the Settings app and go to Accounts section.
  2. Navigate to Family & other people tab. In Other people section click on Add someone else to this PC button.

  3. Select I don’t have this person’s sign-in information.
  4. Now click on Add a user without a Microsoft account.
  5. Enter the desired user name and password for the new user and click the Next button once you’re done.

After creating a new user account you need to log off and switch to it.

If the problem doesn’t appear on your new user account, you might want to consider switching to it and using it as your primary account.

3. Download the latest updates

Microsoft is working hard to address Windows 10 hardware and software issues, and most issues are fixed with Windows updates.

According to users, this issue can be fixed simply by installing the latest updates. Windows 10 installs updates automatically, but you can also check for updates manually if you want.

To do that, follow these simple steps:

  1. Open the Settings app and go to Update & security section.
  2. Click the Check for updates button and wait while Windows 10 downloads the available updates.

After downloading and installing the latest updates, check if the problem is resolved.


4. Stop the problematic processes

Users reported that this issues occurs while trying to install AutoCAD software. It seems that this problem is caused by another AutoCAD process running in the background, so to fix the problem you need to close that process.

This is a simple procedure, and you can do it by using Task Manager. To close the problematic process, do the following:

  1. Press Ctrl + Shift + Esc to open Task Manager.
  2. When Task Manager starts, go to Processes tab and look for any AutoCAD process. Right click it and choose End Task from the menu. Repeat this for all AutoCAD processes.
  3. After ending all problematic processes, close Task Manager and check if the problem is resolved.

Keep in mind that this problem can affect almost any application and not just AutoCAD. Therefore be sure to close multiple instances of the problematic application and check if that solves the problem.

5. Reinstall the problematic application

According to users, Another instance is running error appears when they try to run a specific application. Many users reported that the error appears while trying to run a specific game on their PC.

Some PC issues are hard to tackle, especially when it comes to corrupted repositories or missing Windows files. If you are having troubles fixing an error, your system may be partially broken.
We recommend installing Restoro, a tool that will scan your machine and identify what the fault is.
Click here to download and start repairing.

If you’re having this error with any game or application, we recommend that you reinstall it completely. After reinstalling the problematic software, check if the problem is resolved.


6. Change the Startup type of Workstation service

Users reported that Another instance is running error appears while trying to install updates for certain Adobe products.

It seems that this error is related to Workstation service in Windows 10, and to fix it you need to change that service’s settings. To do that, follow these steps:

  1. Press Windows Key + R to open the Run dialog. Enter services.msc and press Enter or click OK.
  2. Services window will now appear. Locate Workstation service and double click it to open its properties.
  3. Make sure that Startup type is set to Automatic.
  4. Check the Service status. If it isn’t set to Running, start the service by clicking the Start button.
  5. After changing the Startup type and starting the service, click Apply and OK to save changes.
  6. Close Services window and try to install the application again.

1. Close lolpatcher processes

Users reported Another instance is running error while trying to start League of Legends. According to them, the issue appears because lolpatcher application starts simultaneously with the game.

To fix this problem, you need to find and end all running lolpatcher processes. To do this, you’ll need to use Task Manager and find the problematic process in the Process tab.

We already explained how to end a process using Task Manager in one of our previous solutions, so be sure to check it for detailed instructions.

Few users reported that they had multiple League of Legends clients running, but after ending their processes the issue was completely resolved.

2. Run netsh command

If you’re getting Another instance is running error while trying to start League of Legends, you might be able to fix the problem by using Command Prompt.

Users reported that they fixed the issue simply by running netsh winsock reset command. To do that, follow these steps:

  1. Press Windows Key + X to open Win + X menu. Select Command Prompt (Admin) from the list of results.
  2. When Command Prompt starts, enter netsh winsock reset and press Enter.
  3. Wait for the command to execute and then close Command Prompt.
  4. Restart your PC.

After your PC restarts, try running LoL and check if the problem still persists.


According to users, one potential solution is to pin League of Legends icon to your Taskbar and try to start it from there.

Users reported that two League of Legends icons appear in their Taskbar when they want to start it. According to them, you need to pin the new icon to your Taskbar and close the other one.

After doing that, go to Task Manager and close all processes related to the League of Legends. Lastly, start the game by using the pinned Taskbar icon.

Users also reported that you might have to click the icon couple of times before the game starts, so keep that in mind. This isn’t the best solution, but it’s a potential workaround, so you might want to try it out.

4. Run the game as administrator

If you’re getting Another instance is running error while trying to run League of Legends, you might want to try running it as administrator.

This is quite simple, and to do so you’ll need to find the application, right click it and choose Run as administrator from the menu.

If running the application as an administrator fixes the problem, you’ll have to repeat this process every time you want to start the game.

If none of the previous solutions work, you might have to reinstall League of Legends to fix the problem.


Read more about this topic

  • How to Get to Advanced System Settings on Windows 10
  • Windows 10 Undoing Changes Made to Your Computer [Fix]

Another instance is running error will prevent your applications from starting, but you can fix the problem by ending the problematic application.

If that doesn’t work, feel free to try any other solution from this article.

newsletter icon

Newsletter

Понравилась статья? Поделить с друзьями:
  • Ru store ошибка разбора пакета
  • Ru store ошибка при синтаксическом анализе пакета
  • Ru donor error ошибка 3840
  • Rtx voice error initialization failed
  • Rtwlane sys windows 10 как исправить