diff --git a/Dockerfile b/Dockerfile index ada802d..7ab81bb 100755 --- a/Dockerfile +++ b/Dockerfile @@ -76,8 +76,13 @@ RUN mkdir /var/run/sshd ; \ apt-get -y install openssh-server -# Install supervisor & start script -RUN apt-get -y install supervisor +# Install supervisor, vnstat, & start script +# Configure vnstat to always use bytes instead of bits to display statistics +RUN apt-get -y install supervisor vnstat ; \ + chown -R rduser /var/lib/vnstat ; \ + chgrp -R rduser /var/lib/vnstat ; \ + sed -i -e"s/^UnitMode\s0/UnitMode 1/" /etc/vnstat.conf ; \ + sed -i -e"s/^RateUnit\s1/RateUnit 0/" /etc/vnstat.conf COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY start /start RUN chmod +x /start diff --git a/supervisord.conf b/supervisord.conf index 5ac78b3..d5b4c4e 100755 --- a/supervisord.conf +++ b/supervisord.conf @@ -28,3 +28,7 @@ startretries=999999999 [program:cron] command=/usr/sbin/cron -f autorestart=true + +[program:vnstatd] +command=/bin/su -c '/usr/sbin/vnstatd -n' rduser +autorestart=true