We are using jboss EAP-6.4.0/jboss
i am trying to enforce GC every 30 mins. the start up file is as below
NO_GC_LOG_ROTATE=`echo $JAVA_OPTS | $GREP "\-verbose:gc"`
if [ "x$NO_GC_LOG_ROTATE" = "x" ]; then
# backup prior gc logs
mv "$JBOSS_LOG_DIR/gc.log.0" "$JBOSS_LOG_DIR/backupgc.log.0" >/dev/null 2>&1
mv "$JBOSS_LOG_DIR/gc.log.1" "$JBOSS_LOG_DIR/backupgc.log.1" >/dev/null 2>&1
mv "$JBOSS_LOG_DIR/gc.log.2" "$JBOSS_LOG_DIR/backupgc.log.2" >/dev/null 2>&1
mv "$JBOSS_LOG_DIR/gc.log.3" "$JBOSS_LOG_DIR/backupgc.log.3" >/dev/null 2>&1
mv "$JBOSS_LOG_DIR/gc.log.4" "$JBOSS_LOG_DIR/backupgc.log.4" >/dev/null 2>&1
mv "$JBOSS_LOG_DIR"/gc.log.*.current "$JBOSS_LOG_DIR/backupgc.log.current" >/dev/null 2>&1
"$JAVA" $JVM_OPTVERSION -verbose:gc -Xloggc:"$JBOSS_LOG_DIR/gc.log" -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:+UseParallelOldGC **-Dsun.rmi.dgc.client.gcInterval=1800000 -Dsun.rmi.dgc.server.gcInterval=1800000** -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -version >/dev/null 2>&1 && mkdir -p $JBOSS_LOG_DIR && PREPEND_JAVA_OPTS="$PREPEND_JAVA_OPTS -verbose:gc -Xloggc:\"$JBOSS_LOG_DIR/gc.log\" -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading"
fi
Not sure why this isn't working???
GC logs in EAP cannot rotate on a time based rotation. Rather, they can rotate on a size based rotation.
The gc.log can be rolled through JVM settings UseGCLogFileRotation / NumberOfGCLogFiles / GCLogFileSize on the OpenJDK Oracle JDK. For example:
-verbose:gc -Xloggc:gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=1048576
Related
Pls answer me i first time put inside rpm bash skrip. May someone can sent link or tip what i must coorrect in my .spec
This rpm pakage must make just two thing - copy in linux folder /bin/ one file(inet.dbg) and next when cp make must start bash skrip for check library for this file.
This my bash skript
#!/bin/bash
ldd inet.dbg > t.t
ERR=`grep -i "not" t.t | wc -l`
if [[ $ERR -gt 0 ]]; then
grep -i "not" t.t > erg.e
echo "Die folgenden Bibliotheken wurden nicht gefunden:"
cat erg.e
rm t.t erg.e
else
ls -a ss.tar &> t.t
if [[ $? -eq 0 ]]; then
echo alles ok
else
echo no
fi
fi '
This .spec
# %_topdir and %_tmppath are defined in ~/.rpmmacros
%define name inetdbg
%define version 0.1
%define release 1
%define buildroot %{_tmppath}/%{name}-%{version}-%{release}
%define tarfile %{tarversion}.tar
%define installscript /home/adis/rpmbuild/SOURCES/skript.sh
Name: %{name}
Version: %{version}
Release: %{release}
BuildArch: noarch
Summary: adisc
License: -
Source1: %{installscript}
Source2: /home/adis/rpmbuild/SOURCES/inetdbg.tar.xz
BuildRoot: %{_builddir}/%{name}-root
%description
Tested RPM
%prep
%build
%install
mkdir -p %{buildroot}%{_bindir}
install -D -pm 755 %{SOURCE2} %{buildroot}/bin/inetdbg.tar.xz
cp -a %{installscript} %{buildroot}%{_bindir}/
chmod a+x %{buildroot}%{_bindir}/%{installscript}
%files
%{_bindir}/%{installscript}
%{SOURCE2}
%post
%{_bindir}%{installscript}
%clean
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
%changelog
* 25 Jan 2023 <user>
- Add script.sh
- Add definit
Try it make rpmbuild but have fehler when start rpmbuild read skript what i try put
Is it possible to run mongod via upstart and keep track of the PID via start-stop-daemon or otherwise?
After following these instructions on the mongodb docs page for ubuntu installation:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
All remnants of the ubuntu package have been removed prior to this.
I now have a running instance of mongod on boot, via Upstart. But for some reason Upstart and initctl do not know about it. It starts up fine, but initctl thinks it's in stop/waiting state.
To wit:
My /etc/mongod.conf.yml:
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
systemLog:
destination: file
path: /var/log/mongodb/mongod.log
logAppend: true
logRotate: rename
component:
accessControl:
verbosity: 2
net:
bindIp: 127.0.0.1
port: 27017
processManagement:
fork: true
setParameter:
enableLocalhostAuthBypass: false
security:
authorization: disabled
My /etc/init/mongod.conf upstart script (renamed mongodb.pid to mongod.pid):
# Ubuntu upstart file at /etc/init/mongod.conf
# Recommended ulimit values for mongod or mongos
# See http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
#
limit fsize unlimited unlimited
limit cpu unlimited unlimited
limit as unlimited unlimited
limit nofile 64000 64000
limit rss unlimited unlimited
limit nproc 32000 32000
kill timeout 300 # wait 300s between SIGTERM and SIGKILL.
pre-start script
DAEMONUSER=${DAEMONUSER:-mongodb}
if [ ! -d /var/lib/mongod ]; then
mkdir -p /var/lib/mongodb && chown mongodb:mongodb /var/lib/mongodb
fi
if [ ! -d /var/log/mongod ]; then
mkdir -p /var/log/mongodb && chown mongodb:mongodb /var/log/mongodb
fi
touch /var/run/mongod.pid
chown $DAEMONUSER /var/run/mongod.pid;
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
end script
start on runlevel [2345]
stop on runlevel [06]
script
ENABLE_MONGOD="yes"
CONF=/etc/mongod.conf.yml
DAEMON=/usr/bin/mongod
DAEMONUSER=${DAEMONUSER:-mongodb}
if [ -f /etc/default/mongod ]; then . /etc/default/mongod; fi
# Handle NUMA access to CPUs (SERVER-3574)
# This verifies the existence of numactl as well as testing that the command works
NUMACTL_ARGS="--interleave=all"
if which numactl >/dev/null 2>/dev/null && numactl $NUMACTL_ARGS ls / >/dev/null 2>/dev/null
then
NUMACTL="$(which numactl) -- $NUMACTL_ARGS"
DAEMON_OPTS=${DAEMON_OPTS:-"--config $CONF"}
else
NUMACTL=""
DAEMON_OPTS="-- "${DAEMON_OPTS:-"--config $CONF"}
fi
if [ "x$ENABLE_MONGOD" = "xyes" ]
then
exec start-stop-daemon --start \
--chuid $DAEMONUSER \
--pidfile /var/run/mongod.pid \
--make-pidfile \
--exec $NUMACTL $DAEMON $DAEMON_OPTS
fi
end script
After a reboot I see this:
$ ps aux | grep mongo
mongodb 1085 0.2 1.1 363764 46704 ? Sl 11:57 0:06 /usr/bin/mongod --config /etc/mongod.conf.yml
And everything appears to be fine. But the mongod.pid file does not store the same pid as the process:
$ cat /var/run/mongod.pid
985
Should be 1085.
What is the best way to fix this so Upstart has access to the actual PID?
UPDATE: tried to add expect daemon and expect fork with some change in behavior: initctl now sees a PID and denotes that mongod is running, but has the wrong PID. This means any subsequent command like sudo stop mongod or sudo start mongod will hang. Neither fork or daemon seems to fix this; what am I missing?
Ok so a bit of egg on my face - I was overlooking the fact that my shiny new /etc/mongod.conf.yml contained processManagement.fork: true. Setting this to false allows start-stop-daemon to capture the appropriate PID.
As I am implementing digital signage with Dell Monitor.
First thing as I already google there is no option to stop or uninstall screenly & get back to raspberry pi desktop.
I want to know, how we can do that?
pi#raspberrypi ~ $ /opt/vc/bin/tvservice -s
state 0x120016 [DVI DMT (4) RGB full 4:3], 640x480 # 60Hz, progressive
My monitor maximum resolution is 1920x1200 with 16:10 aspect ratio, why tvservice giving me above mentioned output?
thanks in advanced,
Bhushan Vaiude
Here is ans:
ps aux | grep creen
less ~/screenly/misc/gtkrc-2.0
less ~/.config/openbox/lxde-rc.xml.bak
less ~/.config/openbox/lxde-rc.xml
less ~/.config/lxpanel/LXDE/panels/panel.bak
less /etc/xdg/lxsession/LXDE/autostart.bak
ulink /etc/supervisor/conf.d/screenly.conf
unlink /etc/supervisor/conf.d/screenly.conf
sudo unlink /etc/supervisor/conf.d/screenly.conf
sudo unlink ~/.gtkrc-2.0
ls -l ~/.config/openbox/lxde-rc.xml
ls -l ~/.config/
unlink ~/.config/openbox/lxde-rc.xml
ls -l ~/.config/
ls -l ~/.config/openbox/lxde-rc.xml
ls -l ~/.config/mv ~/.config/openbox/lxde-rc.xml.bak ~/.config/openbox/lxde-rc.xml
mv ~/.config/openbox/lxde-rc.xml.bak ~/.config/openbox/lxde-rc.xml
ls -l ~/.config/openbox/lxde-rc.xml
ls ~/.config/lxpanel/LXDE/panels/panel
ls ~/.config/lxpanel/LXDE/panels/pane*
mv ~/.config/lxpanel/LXDE/panels/panel.bak ~/.config/lxpanel/LXDE/panels/panel
sudo ls -l /etc/xdg/lxsession/LXDE/autostart
sudo ls -l /etc/xdg/lxsession/LXDE/autostart*
sudo mv /etc/xdg/lxsession/LXDE/autostart.bak /etc/xdg/lxsession/LXDE/autostart
less /etc/lightdm/lightdm.conf
sudo nano /etc/lightdm/lightdm.conf
#comment xserver-command
sudo shutdown -r now
thanks!
I am having a weird problem with mongodb after installation it is ending with a message
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
dpkg: error processing mongodb-10gen (--configure):
What is wrong here I followed the steps given here: http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages
The issue is that you are trying to install a version packaged for Upstart init services, but Debian Squeeze still uses SysV init by default.
There is a note on this in the install docs:
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian-or-ubuntu-linux/#installing-mongodb
If you are using Debian or Ubuntu that uses SysV style init process, use the following line:
deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen
This means that you need to create mongodb start script in /etc/init.d/
Try this script
#!/bin/bash
#
# mongodb Startup script for the mongodb server
#
# chkconfig: - 64 36
# description: MongoDB Database Server
#
# processname: mongodb
#
# Source function library
. /lib/lsb/init-functions
if [ -f /etc/sysconfig/mongodb ]; then
. /etc/sysconfig/mongodb
fi
prog="mongod"
mongod="/usr/local/mongodb/bin/mongod"
RETVAL=0
start() {
echo -n $"Starting $prog: "
daemon $mongod "--fork --logpath /var/log/mongodb.log --logappend 2>&1 >>/var/log/mongodb.log"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
reload() {
echo -n $"Reloading $prog: "
killproc $prog -HUP
RETVAL=$?
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/$prog ]; then
stop
start
fi
;;
reload)
reload
;;
status)
status $mongod
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
RETVAL=1
esac
exit $RETVAL
after type in terminal:
sudo chmod +x /etc/init.d/mongodb
sudo /etc/init.d/mongodb start
ps -A | grep mongod
I have a java application develeped in netbeans. I want to create a batchfile that recompiles the project and packs the resulting jar files along with some documentation to a zip file and generate an installer.
The packing and generation of the installer is no problem, but I dont know how to automate the compilation from commandline/batchfile - whenever I change something in the source-code I have to manually click on "Clean and Build" inside netbeans and run my batchfile afterwards.
What do I have to add to the batchfile to do the same as "Clean and Build" from inside netbeans?
I found out myself what to do:
Make sure ant is in your path (e.g. I added C:\Programme\NetBeans 6.9.1\java\ant\bin to my PATH environment)
Make sure your JAVA_HOME is set correctly
execute "ant clean" and "ant jar" in the directory of your netbeans project
The batchfile I use:
SET JAVA_HOME=C:\Programme\Java\jdk1.6.0_12
call ant deps-clean
call ant clean
call ant jar
pause
cp -r doc dist
cp -r scripts dist
cp -r examples dist
cp -r crypt dist
cp -r db dist
cp -r license dist
rm dist/README.TXT
cp README.TXT dist
echo package creation %date:~-4,4%_%date:~-7,2%_%date:~0,2% >> dist/README.TXT
cd win_service
RCEDIT.exe /C wizard.exe
RCEDIT.exe /I wizard.exe my_app.ico
RCEDIT.exe /N wizard.exe pre_wizard.ini
RCEDIT.exe /C my_app_service.exe
RCEDIT.exe /I my_app_service.exe my_app.ico
RCEDIT.exe /N my_app_service.exe pre_my_app_service.ini
cp my_app_service.ini ../dist
cp my_app_service.exe ../dist
cp wizard.exe ../dist
cp wizard.ini ../dist
cp service*.bat ../dist
cp *.nsi ../dist
cp *.nsh ../dist
cp my_app.log ../dist
cd ..
cd dist
mkdir windows
cp *.jar windows
cp -r lib windows
cp -r crypt windows
cp -r db windows
cp examples\empty_settings.ini windows\settings_example.ini
mv *.exe windows
mv *.ini windows
mv *.bat windows
mv *.nsi windows
mv *.nsh windows
mv my_app.log windows
cd windows
my_app.nsi
mv my_appInstaller.exe ../my_appInstaller_gpl.exe
rm lib\jdbc-mysql.jar
my_app.nsi
mv my_appInstaller.exe ../my_appInstaller.exe
cd ..
rm -rf my_app
mkdir my_app
mv *.jar my_app
mv lib my_app
mv crypt my_app
mv db my_app
mv examples\empty_settings.ini my_app\settings.ini
ren my_app 9880
mkdir my_app
mv 9880 my_app
7z a -r -tzip my_app_gpl.zip doc license examples scripts my_app README.txt my_appInstaller_gpl.exe
rm my_app\9880\lib\jdbc-mysql.jar
7z a -r -tzip my_app.zip doc license examples scripts my_app README.txt my_appInstaller.exe
cd ..
pause
"Error running javac.exe compiler" Looks if the JDK was not in the PATH.