SnapOverflow

SnapOverflow Logo SnapOverflow Logo

SnapOverflow Navigation

  • Home
  • Server
  • Ubuntu

Mobile menu

Close
  • Home
  • System Administrators
    • Hot Questions
    • New Questions
    • Tags
  • Ubuntu
    • Hot Questions
    • New Questions
    • Tags
  • Help
Home / user-208527

Karl Morrison's questions

Martin Hope
Karl Morrison
Asked: 2018-01-16 08:53:34 +0800 CST

Log when cronjobs has started

  • 3

I have a file which contains a bunch of cron jobs:

30 * * * * someexec somefile
30 1 * * * someexec somefile
30 5 * * * someexec somefile

I'd like for when these cron jobs have been activated that something in the fashion of "Cron job someexec somfile has started" to the log file /var/log/cronjobs.log for example.

I do not want to log what these cron jobs echo when they do run as I have already fixed that. I only want to log that the jobs are active.

cron
  • 1 Answers
  • 174 Views
Martin Hope
Karl Morrison
Asked: 2017-10-07 02:14:16 +0800 CST

Startup redis-server then use bash

  • 1
# Redis
    # Download and extract Redis source files
RUN curl -o redis.tar.gz "http://download.redis.io/releases/redis-4.0.2.tar.gz" && \
    mkdir redis_tmp/ && \
    tar xzf redis.tar.gz -C redis_tmp && \
    # Rename temporary directory
    mv redis_tmp/* redis && \
    # Install Redis
    cd redis && \
    make && \
    make install && \
    # Remove source files
    cd .. && \
    rm -rf redis && \
    # Confirm installation
    redis-server -v

# Cleanup
    # Remove local repository package files
RUN apt-get -y clean

ENTRYPOINT redis-server

CMD bash

Here the last part of my Dockerfile. I'd like to run the following command:

docker run -it test_image

I'd like this image to startup redis-server and leave me using bash.

It leaves me with redis-server though:

kmorrison@Karl ~/dev/test_image (master) $ docker run -it test_image
9:C 06 Oct 10:09:23.266 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
9:C 06 Oct 10:09:23.266 # Redis version=4.0.2, bits=64, commit=00000000, modified=0, pid=9, just started
9:C 06 Oct 10:09:23.266 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 4.0.2 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 9
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

9:M 06 Oct 10:09:23.268 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
9:M 06 Oct 10:09:23.268 # Server initialized
9:M 06 Oct 10:09:23.268 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
9:M 06 Oct 10:09:23.268 * Ready to accept connections

It has something to do with ENTRYPOINT and CMD.

docker
  • 1 Answers
  • 2019 Views
Martin Hope
Karl Morrison
Asked: 2017-08-16 15:09:00 +0800 CST

Webserver in docker container is not reachable via the internet

  • 2

I've been reading: https://docs.docker.com/engine/userguide/networking/#user-defined-networks

I've created my own network (docker network create --driver bridge devils_network):

441be50f3792        bridge              bridge              local
0d73f7c6fe00        devils_network      bridge              local
8e189dda9fef        host                host                local
5ebca4a1e514        none                null                local

I run the container so:

docker run -it -d -v ~/dockervolume/deus:/srv/www --name deus --hostname deus --network=devils_network -p 80:8080 karl/node

And in the dockerfile expose port 8080:

EXPOSE  8080

I've attached a terminal session to the container and inspected the container to make sure the webserver is up and running:

root        17  0.0  0.1   4508   660 ?        S    22:46   0:00 sh -c NODE_PATH="$(pwd)" NODE_ENV=production node hello_world
root        19  0.0  4.3 882896 22004 ?        Sl   22:46   0:00 node hello_world

The webserver is utilizing port 8080 inside the docker container.

I'm running on a DigitalOcean droplet. If I start the server up directly on the host and not via a docker container it works.

docker
  • 2 Answers
  • 4664 Views
Martin Hope
Karl Morrison
Asked: 2017-05-06 00:57:29 +0800 CST

How to setup supervisor 3.3.1 with node.js npm scripts

  • 1

I'm running version 3.3.1.

Apart of my /etc/supervisor/supervisord.conf file:

[program:node]
directory=/srv/www
command=npm run demo
autostart=true
autorestart=true

Apart of my package.json file under scripts:

"demo": "npm run prod",
"prod": "NODE_ENV=production NODE_PATH=\"$(pwd)\" node src/index.js"

I attempt to shutdown the node program via supervisorctl, however it persists.

root@dev-demo-karl:/srv/www# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.2  0.8  50280 18404 ?        Ss   08:43   0:00 /usr/bin/python /usr/bin/supervisord
root         8  0.2  2.4 1003412 49456 ?       Sl   08:43   0:00 npm
root        16  0.9  2.3 295224 47704 ?        SLl  08:43   0:02 /usr/bin/mongod --auth --fork --smallfiles --logpath /var/log/mongodb.log
root        44  0.0  0.0   4512   808 ?        S    08:43   0:00 sh -c npm run prod
root        45  0.2  2.4 1003924 49628 ?       Sl   08:43   0:00 npm
root        56  0.0  0.0   4512   716 ?        S    08:43   0:00 sh -c NODE_ENV=production NODE_PATH="$(pwd)" node src/index.js
root        60  1.5  7.0 1069880 145108 ?      Sl   08:43   0:04 node src/index.js
root        96  0.0  0.1  18244  3340 ?        Ss   08:44   0:00 bash
root       134  0.0  0.1  34424  2896 ?        R+   08:48   0:00 ps aux
root@dev-demo-karl:/srv/www# supervisorctl
mongod                           FATAL     Exited too quickly (process log may have details)
node                             RUNNING   pid 8, uptime 0:05:04
supervisor> stop node
node: stopped
supervisor> status
mongod                           FATAL     Exited too quickly (process log may have details)
node                             STOPPED   May 05 08:48 AM
supervisor> exit
root@dev-demo-karl:/srv/www# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.2  0.9  50280 18448 ?        Ss   08:43   0:00 /usr/bin/python /usr/bin/supervisord
root        16  0.9  2.3 296324 47704 ?        SLl  08:43   0:03 /usr/bin/mongod --auth --fork --smallfiles --logpath /var/log/mongodb.log
root        45  0.2  2.4 1003924 49628 ?       Sl   08:43   0:00 npm
root        56  0.0  0.0   4512   716 ?        S    08:43   0:00 sh -c NODE_ENV=production NODE_PATH="$(pwd)" node src/index.js
root        60  1.4  7.0 1069880 143996 ?      Sl   08:43   0:04 node src/index.js
root        96  0.0  0.1  18244  3340 ?        Ss   08:44   0:00 bash
root       136  0.0  0.1  34424  2892 ?        R+   08:48   0:00 ps aux

I'm wondering how do I setup supervisor with a node npm script properly. The internet guides have shown nothing but what I've done above. I have no control over stopping/starting it.

supervisord
  • 1 Answers
  • 6267 Views
Martin Hope
Karl Morrison
Asked: 2017-03-06 15:35:54 +0800 CST

Systemd After not starting service

  • 3

letsencrypt.service:

[Unit]
Description=Renews letsencrypt certificates
After=network.target letsencrypt_concat_fullchain_privkey.service

[Service]
Type=oneshot
WorkingDirectory=/etc/letsencrypt/
ExecStart=/usr/bin/letsencrypt renew

When I start this service manually: sudo systemctl start letsencrypt it doesn't seem to start the letsencrypt_concat_fullchain_privkey.service service. I've ran sudo systemctl start letsencrypt_concat_fullchain_privkey.service and it works as it should.

What I'm trying to do is that when letsencrypt.service is finished I'd like it to start the letsencrypt_concat_fullchain_privkey.service service.

systemd ubuntu-16.04
  • 2 Answers
  • 1679 Views
Martin Hope
Karl Morrison
Asked: 2017-03-02 14:29:23 +0800 CST

HAProxy 1.7 not resolving docker 1.13.1 container

  • 1

docker ps -a:

de09facf7c91        x/x:x   "/usr/bin/supervisord"   51 minutes ago      Up 24 minutes       8080/tcp                                                                           development-karl
226a1b80a233        x/x:x                                      "/usr/bin/supervisord"   2 hours ago         Up About a minute   0.0.0.0:80-84->80-84/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:1988->1988/tcp, 5672/tcp   haproxy

Started the container with this: docker run --name development-karl -h development-karl -d x/x:x

part of my haproxy.cfg:

backend karl_dev_backend
    balance roundrobin
    option forwardfor
    server      karl_dev development-karl cookie development-karl weight 1 maxconn 1024 check

Get the error in the haproxy logs:

[ALERT] 059/222244 (683) : parsing [/etc/haproxy/haproxy.cfg:67] : 'server karl_dev' : could not resolve address 'development-karl'.
[ALERT] 059/222244 (683) : Failed to initialize server(s) addr.

I don't know why it's not resolving?

EDIT, added answer info:

https://docs.docker.com/engine/userguide/networking/#the-default-bridge-network-in-detail:

Docker does not support automatic service discovery on the default bridge network. If you want to communicate with container names in this default bridge network, you must connect the containers via the legacy docker run --link option.

Legacy is pre version 1.10.

Legacy: https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/

More info on legacy linking: https://docs.docker.com/engine/userguide/networking/work-with-networks/#linking-containers-without-using-user-defined-networks

docker haproxy
  • 1 Answers
  • 1641 Views
Martin Hope
Karl Morrison
Asked: 2016-02-26 08:07:14 +0800 CST

Logstash output-http plugin error 500 when trying to send to slack webhook

  • 3

I'm running a docker container with an ELK stack. Everythings working dandy and fine. I'd like to utilize the https://www.elastic.co/guide/en/logstash/current/plugins-outputs-http.html plugin.

I install the plugin it:

root@elk:/# /opt/logstash/bin/plugin install logstash-output-http
Validating logstash-output-http
Installing logstash-output-http
Installation successful

/etc/logstash/conf.d/logstash.conf main logstash config file:

input {
  beats {
   port => 5044
   type => "logs"
  }
}
filter {
  grok {
    match => { "message" => "\"name\":\"Error\""}
    add_tag => ["error"]
  }
}
output {
  elasticsearch {
    hosts => "localhost:9200"
    sniffing => true
    manage_template => false
    index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
    document_type => "%{[@metadata][type]}"
  }
  if "error" in [tags] {
    http {
      http_method => "post"
      url => "https://hooks.slack.com/services/<MY_ID>"
      format => "json"
      content_type => "application/json"
      message => "{\"text\": \"dis is workinz\"}"
    }
  }
}

I've also tried changing the format in the http:

...
format => "message"
...

The configuration is also tested and is valid:

root@elk:/# /opt/logstash/bin/logstash --configtest -f /etc/logstash/conf.d/logstash.conf 
Configuration OK

Both result in it not working. I double checked to make sure the webhook is working with a test (from the logstash docker container):

curl -H "Content-Type: application/json" -X POST -d '{"text":"testing"}' https://hooks.slack.com/services/<MY_ID>

I know tags are being applied properly, checked in Kibana. Also the if clause is also working as I tested putting elasticsearch inside it and it indeed only sent logs with the added error tags to elasticsearch.

Lastly the holy error message from /var/log/logstash/logstah.log:

{: timestamp => "2016-02-25T15:55:35.926000+0000", 
: message => "[HTTP Output Failure] Encountered non-200 HTTP code 200", 
: response_code => 500, : url => "https://hooks.slack.com/services/<YES_THE_ACTUAL_WEBHOOK_ID_WAS_HERE>", 
: event => # < LogStash::Event: 0x408e202@ metadata = {
        "beat" => "filebeat", "type" => "log"
    }, @accessors = # < LogStash::Util::Accessors: 0x5dc514d7@ store = {
        "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
            "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
        }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
    }, @lut = {
        "@timestamp" => [{
            "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
                "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
            }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
        }, "@timestamp"], "beat" => [{
            "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
                "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
            }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
        }, "beat"], "count" => [{
            "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
                "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
            }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
        }, "count"], "fields" => [{
            "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
                "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
            }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
        }, "fields"], "input_type" => [{
            "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
                "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
            }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
        }, "input_type"], "offset" => [{
            "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
                "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
            }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
        }, "offset"], "source" => [{
            "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
                "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
            }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
        }, "source"], "type" => [{
            "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
                "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
            }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
        }, "type"], "[beat][hostname]" => [{
            "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
        }, "hostname"], "host" => [{
            "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
                "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
            }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
        }, "host"], "tags" => [{
            "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
                "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
            }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
        }, "tags"], "message" => [{
            "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
                "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
            }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
        }, "message"], "[tags]" => [{
            "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
                "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
            }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
        }, "tags"]
    } > , @data = {
        "message" => "{\"name\":\"myapp\",\"hostname\":\"sensu-node-dev\",\"pid\":749,\"level\":50,\"err\":{\"message\":\"Cannot find module 'lol'\",\"name\":\"Error\",\"stack\":\"Error: Cannot find module 'lol'\\n    at Function.Module._resolveFilename (module.js:339:15)\\n    at Function.Module._load (module.js:290:25)\\n    at Module.require (module.js:367:17)\\n    at require (internal/module.js:16:19)\\n    at Object.<anonymous> (/srv/www/dev.site/app.js:27:6)\\n    at next (native)\\n    at Object.<anonymous> (/srv/www/dev.site/node_modules/koa-compose/index.js:29:5)\\n    at next (native)\\n    at onFulfilled (/srv/www/dev.site/node_modules/co/index.js:65:19)\\n    at /srv/www/dev.site/node_modules/co/index.js:54:5\",\"code\":\"MODULE_NOT_FOUND\"},\"msg\":\"Cannot find module 'lol'\",\"time\":\"2016-02-25T15:55:25.509Z\",\"v\":0}", "@version" => "1", "@timestamp" => "2016-02-25T15:55:34.004Z", "beat" => {
            "hostname" => "sensu-node-dev", "name" => "sensu-node-dev"
        }, "count" => 1, "fields" => nil, "input_type" => "log", "offset" => 29352, "source" => "/var/log/bunyan/myapp-info.log", "type" => "log", "host" => "sensu-node-dev", "tags" => ["beats_input_codec_plain_applied", "error"]
    }, @metadata_accessors = # < LogStash::Util::Accessors: 0x22cd112d@ store = {
        "beat" => "filebeat", "type" => "log"
    }, @lut = {
        "[type]" => [{
            "beat" => "filebeat", "type" => "log"
        }, "type"], "[beat]" => [{
            "beat" => "filebeat", "type" => "log"
        }, "beat"]
    } > , @cancelled = false > , : level => : error
}

As you can see it states response_code => 500 internal error. I get the same error with both format => "json" and format => "message".

I'm guessing it has something to do with my configuration (obviously).

logstash
  • 1 Answers
  • 3186 Views
Martin Hope
Karl Morrison
Asked: 2016-02-25 13:54:06 +0800 CST

Get logstash version

  • 15

How does one get the version of Logstash?

root@elk:/usr/share/elasticsearch# bin/logstash --help
bash: bin/logstash: No such file or directory

I have Logstash running on my system. Also.

root@elk:/# logstash -V
bash: logstash: command not found

Also.

root@elk:/# ps aux | grep logstash
logstash  1725 45.3  8.5 1942860 175936 ?      SNl  22:03   0:35 /usr/bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/opt/logstash -Xmx500m -Xss2048k -Djffi.boot.library.path=/opt/logstash/vendor/jruby/lib/jni -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/opt/logstash -XX:HeapDumpPath=/opt/logstash/heapdump.hprof -Xbootclasspath/a:/opt/logstash/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/opt/logstash/vendor/jruby -Djruby.lib=/opt/logstash/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main --1.9 /opt/logstash/lib/bootstrap/environment.rb logstash/runner.rb agent -f /etc/logstash/conf.d -l /var/log/logstash/logstash.log
root      1777  0.0  0.0   8860   636 ?        S+   22:05   0:00 grep --color=auto logstash

More.

root@elk:/opt/logstash/bin# ls
logstash  logstash.bat  logstash.lib.sh  plugin  plugin.bat  rspec  rspec.bat  setup.bat
root@elk:/opt/logstash/bin# logstash -V
bash: logstash: command not found
ubuntu-14.04
  • 9 Answers
  • 52542 Views
Martin Hope
Karl Morrison
Asked: 2015-12-10 05:08:32 +0800 CST

haproxy sendmsg logger #1 failed: No such file or directory

  • 7

I get the error:

[ALERT] 342/125339 (1) : sendmsg logger #1 failed: No such file or directory (errno=2)

/srv/dockervolume/haproxy/etc/rsyslog.d/49-haproxy.conf file:

$AddUnixListenSocket /var/lib/haproxy/dev/log

local0.* -/var/log/haproxy/haproxy_0.log
local1.* -/var/log/haproxy/haproxy_1.log

if ($programname == 'haproxy') then -/var/log/haproxy/haproxy.log
& ~

/srv/dockervolume/haproxy/etc/haproxy/haproxy.cfg file:

global
    log /var/lib/haproxy/dev/log local0 debug
    chroot /var/lib/haproxy
    maxconn 2048
    tune.ssl.default-dh-param 2048
    stats socket /run/haproxy/admin.sock mode 660 level admin
    stats timeout 30s
    user haproxy
    group haproxy

defaults
    log     global
    mode    http
    option  httplog
    option  dontlognull
    retries 3
    timeout connect 5000
    timeout client  10000
    timeout server  10000

backend my_backend
    log /var/lib/haproxy/dev/log local0 debug

rsyslog is running:

root@haproxy:/# ps aux | grep rsys         
syslog      37  0.0  0.0 116572  1876 ?        Sl+  12:57   0:00 rsyslogd -n -c5

And haproxy is working well otherwise!

haproxy
  • 1 Answers
  • 14432 Views
Martin Hope
Karl Morrison
Asked: 2015-11-26 07:54:11 +0800 CST

Supervisord creating multiple instances

  • 1
[supervisord]
nodaemon=true

[program:haproxy]
command=service haproxy start
numprocs=1
autostart=true
autorestart=true

The conf file is creating four instances. Any ideas why this is happening?

root@haproxy:/etc/init.d# ps aux | grep haproxy
haproxy     18  0.0  1.1  39436  5760 ?        Ss   15:42   0:00 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -D -p /var/run/haproxy.pid
haproxy     27  0.0  1.3  39572  6944 ?        Ss   15:42   0:00 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -D -p /var/run/haproxy.pid
haproxy     36  0.0  1.1  39436  5768 ?        Ss   15:42   0:00 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -D -p /var/run/haproxy.pid
haproxy     45  0.0  1.1  39436  5768 ?        Ss   15:42   0:00 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -D -p /var/run/haproxy.pid
root        69  0.0  0.1   8860   648 ?        S+   15:53   0:00 grep --color=auto haproxy
supervisord
  • 1 Answers
  • 2284 Views
Martin Hope
Karl Morrison
Asked: 2015-11-26 04:49:42 +0800 CST

rsyslog (exit status 0; not expected)

  • 1

Before:

root@haproxy:/# ps aux | grep rsyslog
root       420  0.0  0.1   8860   648 ?        S+   12:38   0:00 grep --color=auto rsyslog

Start Supervisord and error:

root@haproxy:/# /usr/bin/supervisord
/usr/lib/python2.7/dist-packages/supervisor/options.py:295: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
2015-11-25 12:06:59,742 CRIT Supervisor running as root (no user in config file)
2015-11-25 12:06:59,743 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2015-11-25 12:06:59,769 INFO RPC interface 'supervisor' initialized
2015-11-25 12:06:59,770 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2015-11-25 12:06:59,770 INFO supervisord started with pid 211
2015-11-25 12:07:00,774 INFO spawned: 'rsyslog' with pid 214
2015-11-25 12:07:00,845 INFO exited: rsyslog (exit status 0; not expected)
2015-11-25 12:07:01,849 INFO spawned: 'rsyslog' with pid 232
2015-11-25 12:07:01,874 INFO exited: rsyslog (exit status 0; not expected)
2015-11-25 12:07:03,879 INFO spawned: 'rsyslog' with pid 243
2015-11-25 12:07:03,902 INFO exited: rsyslog (exit status 0; not expected)
2015-11-25 12:07:06,907 INFO spawned: 'rsyslog' with pid 254
2015-11-25 12:07:06,926 INFO exited: rsyslog (exit status 0; not expected)
2015-11-25 12:07:07,928 INFO gave up: rsyslog entered FATAL state, too many start retries too quickly

After:

root@haproxy:/# ps aux | grep rsyslog
syslog     435  0.1  0.2 116572  1208 ?        Ssl  12:39   0:00 /usr/sbin/rsyslogd
root       474  0.0  0.1   8860   648 ?        S+   12:39   0:00 grep --color=auto rsyslog

File /etc/supervisor/conf.d/supervisord.conf:

[supervisord]
nodaemon=true

[program:rsyslog]
command=service rsyslog start
startsecs=5

I can start up rsyslog manually without any issue with:

service rsyslog start

So as you can see, before I go ahead and start supervisord rsyslog is not running. After I run the supervisord it does indeed start rsyslog however spawns and exits. Anyone know the reason behind this?

supervisord
  • 1 Answers
  • 2525 Views
Martin Hope
Karl Morrison
Asked: 2015-11-26 02:12:31 +0800 CST

Supervisord commands to start rsyslog and haproxy

  • 2

I've been trying to get these two to start when my docker image starts but they never seem to start.

[supervisord]
nodaemon=true

[program:rsyslog]
command=/bin/bash "service rsyslog start"

[program:haproxy]
command=/bin/bash "service haproxy start"

What command is needed to start both in the order of rsyslog first then haproxy?

supervisord
  • 3 Answers
  • 2545 Views
Martin Hope
Karl Morrison
Asked: 2015-11-24 16:36:08 +0800 CST

How to fix simple HAProxy logging

  • 3

I am running Ubuntu 14.04 and I am wondering how I can log everything that happens in HAProxy. I've been reading issues concerning logging and chroot. Everything is telling me to do write different things in different files.

/var/log# ls
alternatives.log  apt  bootstrap.log  btmp  dmesg  dpkg.log  faillog  fsck  lastlog  upstart  wtmp

/etc/rsyslog.d# ls
49-haproxy.conf  50-default.conf

My /etc/haproxy/haproxy.cfg file contains this:

global
    log 127.0.0.1 local0
    maxconn 2048
    tune.ssl.default-dh-param 2048
    stats socket /run/haproxy/admin.sock mode 660 level admin
    stats timeout 30s
    user haproxy
    group haproxy

defaults
    log     global
    mode    http
    option  httplog
    option  dontlognull
    retries 3
    timeout connect 5000
    timeout client  10000
    timeout server  10000

I can't seem to see any logs anywhere!

haproxy
  • 2 Answers
  • 10752 Views
Martin Hope
Karl Morrison
Asked: 2015-09-17 10:28:26 +0800 CST

Redis (error) NOAUTH Authentication required

  • 58

I get the error:

(error) NOAUTH Authentication required.

When in redis-cli and trying to display the KEYS *. I've only set a requirepass not an auth afaiac. I'm in the redis.conf but do not know what to do.

redis
  • 7 Answers
  • 172184 Views
Martin Hope
Karl Morrison
Asked: 2015-09-12 11:35:10 +0800 CST

HAProxy reverse proxying with Docker not working

  • 1

I have one server. On this server I have one haproxy container, 2x node containers. I am trying to split up the following.

https://mydomain -> 1e node container (x.x.x.x:8080)
https://mydomain:81 -> 2e node container (x.x.x.x:8080)

My config:

global
    log 127.0.0.1 local0 notice
    maxconn 2048
    tune.ssl.default-dh-param 2048
    stats socket /run/haproxy/admin.sock mode 660 level admin
    stats timeout 30s
    user haproxy
    group haproxy

defaults
    log     global
    mode    http
    option  httplog
    option  dontlognull
    retries 3
    timeout connect 5000
    timeout client  10000
    timeout server  10000

listen stats
    bind *:1988 ssl crt /srv/ssl.io.pem
    stats enable
    stats hide-version
    stats realm Haproxy\ Statistics
    stats uri /haproxy
    stats auth myuser:mypassword

frontend http-in-beta
    bind *:81 ssl crt /srv/ssl.io.pem
    acl host_mydomain_com_beta      hdr_beg(host) -i mydomain.com
    use_backend mydomain_beta      if host_mydomain_com_beta

frontend http-in
    bind *:80
    redirect scheme https code 301 if !{ ssl_fc } # redirect all traffic to https

frontend https-in
    bind *:443 ssl crt /srv/ssl.io.pem
    acl host_mydomain_com          hdr_beg(host) -i mydomain.com
    use_backend mydomain_cluster   if host_mydomain_com

backend mydomain_beta
    balance roundrobin
    option forwardfor
    server mydomain_beta 172.17.0.110:8080

backend mydomain_cluster
    balance roundrobin
    option forwardfor
    server mydomain_node_s1 172.17.0.109:8080

Now the issue I am getting, is that sometimes it works. Sometimes I receive a 503. It's frustrating!

Feels like port 81 and 80 are somehow colliding?

haproxy
  • 1 Answers
  • 1265 Views
Martin Hope
Karl Morrison
Asked: 2015-09-12 08:54:42 +0800 CST

Docker run command, expose port private only

  • 1
docker run -it -p 8080 myimage /bin/bash

I would expect the code above to expose port 8080 private. However when I run:

docker ps -a

It shows:

0.0.0.0:32770->8080/tcp

How does one set port 8080 to expose only private?

port
  • 1 Answers
  • 472 Views
Martin Hope
Karl Morrison
Asked: 2015-09-11 11:44:29 +0800 CST

HAProxy stats page not working

  • 2
global
    log 127.0.0.1 local0 notice
    maxconn 2048
    tune.ssl.default-dh-param 2048
    stats socket /run/haproxy/admin.sock mode 660 level admin
    stats timeout 30s
    user haproxy
    group haproxy

defaults
    log     global
    mode    http
    option  httplog
    option  dontlognull
    retries 3
    timeout connect 5000
    timeout client  10000
    timeout server  10000

listen stats
    bind *:1988 ssl crt /srv/mypem.pem
    stats enable
    stats hide-version
    stats realm Haproxy\ Statistics
    stats uri /haproxy
    stats auth user:password

frontend http-in
    bind *:80
    redirect scheme https code 301 if !{ ssl_fc } # redirect all traffic to https

frontend https-in
    bind *:443 ssl crt /srv/mypem.pem
    acl host_mydomain_com       hdr_beg(host) -i mydomain.com
    use_backend mydomain_cluster        if host_mydomain_com

backend mydomain_cluster
    balance leastconn
    option forwardfor
    server s1 x.x.x.x:8080

I can't seem to get the stats page showing in HAProxy. Above is my config.

haproxy
  • 1 Answers
  • 8285 Views
Martin Hope
Karl Morrison
Asked: 2015-09-09 14:20:41 +0800 CST

Docker container SSHOpen not staying up

  • 5

I am trying to create an image which contains an openssh server and start it when invoking the run command. I have taken the following steps:

docker pull ubuntu
docker run -d -it ubuntu bash
apt-get update
apt-get install openssh-server -y
exit
docker ps -a 
docker commit <CONTAINER ID> myimg
// tried the following three, same results
docker run -d myimg "/usr/sbin/sshd"
docker run -d myimg /usr/sbin/sshd -D
docker run -d myimg service ssh start

This runs the image then exits immediately, I am trying to get the service to keep up. What Am I doing wrong?

ssh
  • 1 Answers
  • 3717 Views
Martin Hope
Karl Morrison
Asked: 2015-05-14 09:22:21 +0800 CST

POP3 and IMAP: Setup Gmail & Zoho

  • 2

I wish to use Gmail to handle all of my email needs. Sending, reading, deleting, moving, forwarding etc.. I have a domain with an email at Zoho [email protected], this is working well.

I've always been confused with POP3 and IMAP regarding which server/client does what. Reading What's the difference between POP3 and IMAP for e-mail? hasen't really made me any smarter.

Here is a flow of the email from [email protected] which I would like:

Incoming email(to: [email protected]) -> Zoho inbox([email protected]) -> Gmail account([email protected]) -> Android client/Web browser

I also would like to send:

Android client/Web browser -> Gmail account([email protected]) -> Zoho account([email protected]) -> Send email(from: [email protected])

I would also like to setup so that via Gmail I can send emails via [email protected].

You can say that Gmail is central. How would I set this up? I am guessing it is better to use IMAP as POP3 is old. I would also like to keep copies on Zoho that are not affected by Gmail, so if I delete a message on Gmail that went to [email protected] it would not delete on Zoho (use Zoho as a backup).

What should be the IMAP/POP3 server in this case?

Zoho

POP Configuration details:

  • Incoming server: pop.zoho.com, Port: 995, SSL
  • Outgoing server: smtp.zoho.com, Port: 465, SSL

IMAP Configuration details:

  • Incoming server: imap.zoho.com, Port: 993, SSL
  • Outgoing server: smtp.zoho.com, Port: 465, SSL

Gmail

Incoming Mail (IMAP) Server - Requires SSL

  • imap.gmail.com Port: 993 Requires SSL:Yes

Outgoing Mail (SMTP) Server - Requires TLS

  • smtp.gmail.com Port: 465 or 587 Requires SSL: Yes Requires authentication: Yes Use same settings as incoming mail server

Incoming vs. Outgoing on Zoho

  1. Incoming: Does this mean when Gmail pushes from it's outgoing server to Zohos incoming server?
  2. Outgoing: Zoho to push from its outgoing server to Gmails incoming server?

Incoming vs. Outgoing on Gmail

  1. Incoming: Does this mean from my Android client/web browser to push to Gmails incoming server?
  2. Outgoing: Gmail outgoing server to push to Zohos incoming server?

What do I do in Zoho and what do I do in Gmail?

email
  • 1 Answers
  • 3589 Views
Martin Hope
Karl Morrison
Asked: 2015-03-27 13:56:58 +0800 CST

OpenShift access via terminal (SSH) [Permission denied (publickey,gssapi-keyex,gssapi-with-mic).]

  • 3

I'm currently sitting on Ubuntu and would like remote access to my application on OpenShift. I have done the following to create a ssh-rsa key (I've replaced the fingerprint with xx:xx...):

> mkdir ~/.ssh
> chmod 700 ~/.ssh
> ssh-keygen -t rsa                                      
Generating public/private rsa key pair.
Enter file in which to save the key (/home/karl/.ssh/id_rsa): openshiftKey
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in openshiftKey.
Your public key has been saved in openshiftKey.pub.
The key fingerprint is:
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx karl@karllaptop
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
... the rest of the image

This creates two files(notice they are not in ~/.ssh):

~/openshiftKey
~/openshiftKey.pub

I do not know where these files belong, the examples and tutorials say nothing of moving them.

I open the openshiftKey.pub and copy the code:

enter image description here

I paste it into Openshift:

enter image description here

Click save:

enter image description here

Go back to the application settings page and copy the ssh link:

enter image description here

And on my terminal try and connect:

enter image description here

I am sorry as I am new to ssh in this degree, what am I doing wrong?

ssh
  • 1 Answers
  • 8691 Views

Sidebar

Stats

  • Questions 681965
  • Answers 980273
  • Best Answers 280204
  • Users 287326
  • Popular
  • Answers
  • Marko Smith

    Can you pass user/pass for HTTP Basic Authentication in URL parameters?

    • 5 Answers
  • Marko Smith

    Ping a Specific Port

    • 18 Answers
  • Marko Smith

    Check if port is open or closed on a Linux server?

    • 7 Answers
  • Marko Smith

    How to automate SSH login with password?

    • 10 Answers
  • Marko Smith

    How do I tell Git for Windows where to find my private RSA key?

    • 30 Answers
  • Marko Smith

    What's the default superuser username/password for postgres after a new install?

    • 5 Answers
  • Marko Smith

    What port does SFTP use?

    • 6 Answers
  • Marko Smith

    Command line to list users in a Windows Active Directory group?

    • 9 Answers
  • Marko Smith

    What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats?

    • 3 Answers
  • Marko Smith

    How to determine if a bash variable is empty?

    • 15 Answers
  • Martin Hope
    Davie Ping a Specific Port 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    Smudge Our security auditor is an idiot. How do I give him the information he wants? 2011-07-23 14:44:34 +0800 CST
  • Martin Hope
    kernel Can scp copy directories recursively? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh returns "Bad owner or permissions on ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil How to automate SSH login with password? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin How do I deal with a compromised server? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner How can I sort du -h output by size 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent How to determine if a bash variable is empty? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus How do you find what process is holding a file open in Windows? 2009-05-01 16:47:16 +0800 CST

Related Questions

Trending Tags

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Home
  • Questions
    • Hot Questions
    • New Questions
  • Tags
  • Help

Footer

SnapOverflow

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Help

© 2022 SOF-TR. All Rights Reserve