I am using 2.6.4-1. Since rundeck logs dont archive or rotate themselves or don't drop a conf into logrotate with the installation; what is the best way to rotate and archive it..?
I can manually drop a config into logrotate so it can rotate and archive it, may be I can use copytruncate since Java apps (such as Rundeck) usually ignore UNIX signals like SIGHUP and SIGUSR1 but what stopping me using logrotate is, rundeck is trying to rotate the logs with appending a date stamp and keeping it there without archiving.This makes logrotate not working as expected. Since the size of the logs keep on growing, any alternatives for rundeck log rotation,archiving.
Or help me on how to avoid rundeck to try rotate the logs with appending a date stamp into the log name. Like rundeck.access.log turns to rundeck.access.log.2017-06-02 which makes logrotate to not working on archiving it.
Thanks in advance.
Leo Prince
As you already know that Rundeck uses log4f as its application logging facility. All logging is controlled by log4j. The log config file is RD_BASE/log4j.properties or RD_BASE/etc/log4j.properties if you are using launcher.
If you look into your log4j.properties file. You will find for the config for all files that appear under /var/log/rundeck/ directory have following setting:
log4j.appender.cmd-logger=org.apache.log4j.DailyRollingFileAppender
log4j.appender.cmd-logger.file=/var/log/rundeck/command.log
log4j.appender.cmd-logger.datePattern='.'yyyy-MM-dd
log4j.appender.cmd-logger.append=true
log4j.appender.cmd-logger.layout=org.apache.log4j.PatternLayout
log4j.appender.cmd-logger.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c - %m%n
org.apache.log4j.DailyRollingFileAppender makes log file rotate dailly.
The log file name will have a dateParttern as '.'yyyy-MM-dd
log4j log rotation and archive
TimeBasedRollingPolicy
The setting you are looking for is FileNamePattern
Here is an example on how to log rotate and archive using log4j
How to make log files rotate per day and zip old rotated logs using log4j.properties
The previous answer doesn't seem to work in log4j2. Here is my log4j2.properties file that rotates the archived logs every 2 days:
name = Rundeck Logging Configuration
property.baseDir = /var/log/rundeck
property.classLength = 2
property.noConsoleNoAnsi = true
property.prefix = [%style{%d{ISO8601}}{dim, noConsoleNoAnsi=${noConsoleNoAnsi}}] %highlight{%-5p}{noConsoleNoAnsi=${noConsoleNoAnsi}} %style{%c{${classLength}}}{cyan,noConsoleNoAnsi=${noConsoleNoAnsi}}
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = ${prefix} - %m%n
appender.rundeck.type = RollingFile
appender.rundeck.name = rundeck
appender.rundeck.fileName = ${baseDir}/rundeck.log
appender.rundeck.append = true
appender.rundeck.bufferedIO = true
appender.rundeck.filePattern = ${baseDir}/rundeck.log.%d{yyyy-MM-dd}.gz
appender.rundeck.layout.type = PatternLayout
appender.rundeck.layout.pattern = ${prefix} [%t] - %m%n
appender.rundeck.policies.type = Policies
appender.rundeck.policies.time.type = TimeBasedTriggeringPolicy
appender.rundeck.policies.time.interval = 1
appender.rundeck.strategy.type = DefaultRolloverStrategy
appender.rundeck.strategy.delete.type = Delete
appender.rundeck.strategy.delete.basePath = ${baseDir}
appender.rundeck.strategy.delete.maxDepth = 1
appender.rundeck.strategy.delete.ifFileName.type = IfFileName
appender.rundeck.strategy.delete.ifFileName.glob = rundeck.log.*.gz
appender.rundeck.strategy.delete.ifLastModified.type = IfLastModified
appender.rundeck.strategy.delete.ifLastModified.age = 2d
appender.audit.type = RollingFile
appender.audit.name = audit
appender.audit.fileName = ${baseDir}/rundeck.audit.log
appender.audit.append = true
appender.audit.bufferedIO = true
appender.audit.filePattern = ${baseDir}/rundeck.audit.log.%d{yyyy-MM-dd}.gz
appender.audit.layout.type = PatternLayout
appender.audit.layout.pattern = ${prefix} - %m%n
appender.audit.policies.type = Policies
appender.audit.policies.time.type = TimeBasedTriggeringPolicy
appender.audit.policies.time.interval = 1
appender.audit.strategy.type = DefaultRolloverStrategy
appender.audit.strategy.delete.type = Delete
appender.audit.strategy.delete.basePath = ${baseDir}
appender.audit.strategy.delete.maxDepth = 1
appender.audit.strategy.delete.ifFileName.type = IfFileName
appender.audit.strategy.delete.ifFileName.glob = rundeck.audit.log.*.gz
appender.audit.strategy.delete.ifLastModified.type = IfLastModified
appender.audit.strategy.delete.ifLastModified.age = 2d
appender.options.type = RollingFile
appender.options.name = options
appender.options.fileName = ${baseDir}/rundeck.options.log
appender.options.append = true
appender.options.bufferedIO = true
appender.options.filePattern = ${baseDir}/rundeck.options.log.%d{yyyy-MM-dd}.gz
appender.options.layout.type = PatternLayout
appender.options.layout.pattern = ${prefix} %X{httpStatusCode} %X{contentLength}B %X{durationTime}ms %X{lastModifiedDateTime} [%X{jobName}] %X{url} %X{contentSHA1}%n
appender.options.policies.type = Policies
appender.options.policies.time.type = TimeBasedTriggeringPolicy
appender.options.policies.time.interval = 1
appender.options.strategy.type = DefaultRolloverStrategy
appender.options.strategy.delete.type = Delete
appender.options.strategy.delete.basePath = ${baseDir}
appender.options.strategy.delete.maxDepth = 1
appender.options.strategy.delete.ifFileName.type = IfFileName
appender.options.strategy.delete.ifFileName.glob = rundeck.options.log.*.gz
appender.options.strategy.delete.ifLastModified.type = IfLastModified
appender.options.strategy.delete.ifLastModified.age = 2d
appender.storage.type = RollingFile
appender.storage.name = storage
appender.storage.fileName = ${baseDir}/rundeck.storage.log
appender.storage.append = true
appender.storage.bufferedIO = true
appender.storage.filePattern = ${baseDir}/rundeck.storage.log.%d{yyyy-MM-dd}.gz
appender.storage.layout.type = PatternLayout
appender.storage.layout.pattern = ${prefix} %X{action} %X{type} %X{path} %X{status} %X{metadata}%n
appender.storage.policies.type = Policies
appender.storage.policies.time.type = TimeBasedTriggeringPolicy
appender.storage.policies.time.interval = 1
appender.storage.strategy.type = DefaultRolloverStrategy
appender.storage.strategy.delete.type = Delete
appender.storage.strategy.delete.basePath = ${baseDir}
appender.storage.strategy.delete.maxDepth = 1
appender.storage.strategy.delete.ifFileName.type = IfFileName
appender.storage.strategy.delete.ifFileName.glob = rundeck.storage.log.*.gz
appender.storage.strategy.delete.ifLastModified.type = IfLastModified
appender.storage.strategy.delete.ifLastModified.age = 2d
appender.jobchanges.type = RollingFile
appender.jobchanges.name = jobchanges
appender.jobchanges.fileName = ${baseDir}/rundeck.jobs.log
appender.jobchanges.append = true
appender.jobchanges.bufferedIO = true
appender.jobchanges.filePattern = ${baseDir}/rundeck.jobs.log.%d{yyyy-MM-dd}.gz
appender.jobchanges.layout.type = PatternLayout
appender.jobchanges.layout.pattern = ${prefix} %X{user} %X{change} [%X{id}] %X{project} "%X{groupPath}/%X{jobName}" (%X{method})%X{extraInfo}%n
appender.jobchanges.policies.type = Policies
appender.jobchanges.policies.time.type = TimeBasedTriggeringPolicy
appender.jobchanges.policies.time.interval = 1
appender.jobchanges.strategy.type = DefaultRolloverStrategy
appender.jobchanges.strategy.delete.type = Delete
appender.jobchanges.strategy.delete.basePath = ${baseDir}
appender.jobchanges.strategy.delete.maxDepth = 1
appender.jobchanges.strategy.delete.ifFileName.type = IfFileName
appender.jobchanges.strategy.delete.ifFileName.glob = rundeck.jobs.log.*.gz
appender.jobchanges.strategy.delete.ifLastModified.type = IfLastModified
appender.jobchanges.strategy.delete.ifLastModified.age = 2d
appender.execevents.type = RollingFile
appender.execevents.name = execevents
appender.execevents.fileName = ${baseDir}/rundeck.executions.log
appender.execevents.append = true
appender.execevents.bufferedIO = true
appender.execevents.filePattern = ${baseDir}/rundeck.executions.log.%d{yyyy-MM-dd}.gz
appender.execevents.layout.type = PatternLayout
appender.execevents.layout.pattern = ${prefix} %X{eventUser} %X{event} [%X{id}:%X{state}] %X{project} %X{user}/%X{abortedby} \"%X{groupPath}/%X{jobName} %X{argString}\"[%X{uuid}] %n
appender.execevents.policies.type = Policies
appender.execevents.policies.time.type = TimeBasedTriggeringPolicy
appender.execevents.policies.time.interval = 1
appender.execevents.strategy.type = DefaultRolloverStrategy
appender.execevents.strategy.delete.type = Delete
appender.execevents.strategy.delete.basePath = ${baseDir}
appender.execevents.strategy.delete.maxDepth = 1
appender.execevents.strategy.delete.ifFileName.type = IfFileName
appender.execevents.strategy.delete.ifFileName.glob = rundeck.executions.log.*.gz
appender.execevents.strategy.delete.ifLastModified.type = IfLastModified
appender.execevents.strategy.delete.ifLastModified.age = 2d
appender.apirequests.type = RollingFile
appender.apirequests.name = apirequests
appender.apirequests.fileName = ${baseDir}/rundeck.api.log
appender.apirequests.append = true
appender.apirequests.bufferedIO = true
appender.apirequests.filePattern = ${baseDir}/rundeck.api.log.%d{yyyy-MM-dd}.gz
appender.apirequests.layout.type = PatternLayout
appender.apirequests.layout.pattern = ${prefix} "%X{method} %X{uri}" %X{remoteHost} %X{secure} %X{remoteUser} %X{authToken} %X{duration} %X{project} (%X{userAgent})%n
appender.apirequests.policies.type = Policies
appender.apirequests.policies.time.type = TimeBasedTriggeringPolicy
appender.apirequests.policies.time.interval = 1
appender.apirequests.strategy.type = DefaultRolloverStrategy
appender.apirequests.strategy.delete.type = Delete
appender.apirequests.strategy.delete.basePath = ${baseDir}
appender.apirequests.strategy.delete.maxDepth = 1
appender.apirequests.strategy.delete.ifFileName.type = IfFileName
appender.apirequests.strategy.delete.ifFileName.glob = rundeck.api.log.*.gz
appender.apirequests.strategy.delete.ifLastModified.type = IfLastModified
appender.apirequests.strategy.delete.ifLastModified.age = 2d
appender.access.type = RollingFile
appender.access.name = access
appender.access.fileName = ${baseDir}/rundeck.access.log
appender.access.append = true
appender.access.bufferedIO = true
appender.access.filePattern = ${baseDir}/rundeck.access.log.%d{yyyy-MM-dd}.gz
appender.access.layout.type = PatternLayout
appender.access.layout.pattern = ${prefix} "%X{method} %X{uri}" %X{remoteHost} %X{secure} %X{remoteUser} %X{authToken} %X{duration} %X{project} [%X{contentType}] (%X{userAgent})%n
appender.access.policies.type = Policies
appender.access.policies.time.type = TimeBasedTriggeringPolicy
appender.access.policies.time.interval = 1
appender.access.strategy.type = DefaultRolloverStrategy
appender.access.strategy.delete.type = Delete
appender.access.strategy.delete.basePath = ${baseDir}
appender.access.strategy.delete.maxDepth = 1
appender.access.strategy.delete.ifFileName.type = IfFileName
appender.access.strategy.delete.ifFileName.glob = rundeck.access.log.*.gz
appender.access.strategy.delete.ifLastModified.type = IfLastModified
appender.access.strategy.delete.ifLastModified.age = 2d
appender.project.type = RollingFile
appender.project.name = project
appender.project.fileName = ${baseDir}/rundeck.project.log
appender.project.append = true
appender.project.bufferedIO = true
appender.project.filePattern = ${baseDir}/rundeck.project.log.%d{yyyy-MM-dd}.gz
appender.project.layout.type = PatternLayout
appender.project.layout.pattern = ${prefix} - %m%n
appender.project.policies.type = Policies
appender.project.policies.time.type = TimeBasedTriggeringPolicy
appender.project.policies.time.interval = 1
appender.project.strategy.type = DefaultRolloverStrategy
appender.project.strategy.delete.type = Delete
appender.project.strategy.delete.basePath = ${baseDir}
appender.project.strategy.delete.maxDepth = 1
appender.project.strategy.delete.ifFileName.type = IfFileName
appender.project.strategy.delete.ifFileName.glob = rundeck.project.log.*.gz
appender.project.strategy.delete.ifLastModified.type = IfLastModified
appender.project.strategy.delete.ifLastModified.age = 2d
appender.cleanup.type = RollingFile
appender.cleanup.name = cleanup
appender.cleanup.fileName = ${baseDir}/rundeck.cleanup.log
appender.cleanup.append = true
appender.cleanup.bufferedIO = true
appender.cleanup.filePattern = ${baseDir}/rundeck.cleanup.log.%d{yyyy-MM-dd}.gz
appender.cleanup.layout.type = PatternLayout
appender.cleanup.layout.pattern = ${prefix} - %m%n
appender.cleanup.policies.type = Policies
appender.cleanup.policies.time.type = TimeBasedTriggeringPolicy
appender.cleanup.policies.time.interval = 1
appender.cleanup.strategy.type = DefaultRolloverStrategy
appender.cleanup.strategy.delete.type = Delete
appender.cleanup.strategy.delete.basePath = ${baseDir}
appender.cleanup.strategy.delete.maxDepth = 1
appender.cleanup.strategy.delete.ifFileName.type = IfFileName
appender.cleanup.strategy.delete.ifFileName.glob = rundeck.cleanup.log.*.gz
appender.cleanup.strategy.delete.ifLastModified.type = IfLastModified
appender.cleanup.strategy.delete.ifLastModified.age = 2d
appender.webhooks.type = RollingFile
appender.webhooks.name = webhooks
appender.webhooks.fileName = ${baseDir}/rundeck.webhooks.log
appender.webhooks.append = true
appender.webhooks.bufferedIO = true
appender.webhooks.filePattern = ${baseDir}/rundeck.webhooks.log.%d{yyyy-MM-dd}.gz
appender.webhooks.layout.type = PatternLayout
appender.webhooks.layout.pattern = ${prefix} - %m%n
appender.webhooks.policies.type = Policies
appender.webhooks.policies.time.type = TimeBasedTriggeringPolicy
appender.webhooks.policies.time.interval = 1
appender.webhooks.strategy.type = DefaultRolloverStrategy
appender.webhooks.strategy.delete.type = Delete
appender.webhooks.strategy.delete.basePath = ${baseDir}
appender.webhooks.strategy.delete.maxDepth = 1
appender.webhooks.strategy.delete.ifFileName.type = IfFileName
appender.webhooks.strategy.delete.ifFileName.glob = rundeck.webhooks.log.*.gz
appender.webhooks.strategy.delete.ifLastModified.type = IfLastModified
appender.webhooks.strategy.delete.ifLastModified.age = 2d
rootLogger.level = warn
rootLogger.appenderRef.stdout.ref = STDOUT
rootLogger.appenderRef.rundeck.ref = rundeck
logger.interceptors.name = rundeck.interceptors
logger.interceptors.level = info
logger.interceptors.additivity = false
logger.interceptors.appenderRef.stdout.ref = STDOUT
logger.rundeckapp.name = rundeckapp
logger.rundeckapp.level = info
logger.rundeckapp.additivity = false
logger.rundeckapp.appenderRef.stdout.ref = STDOUT
logger.bootstrap.name = rundeckapp.BootStrap
logger.bootstrap.level = info
logger.bootstrap.additivity = false
logger.bootstrap.appenderRef.stdout.ref = STDOUT
logger.grails.name = grails
logger.grails.level = warn
logger.grails.additivity = false
logger.grails.appenderRef.stdout.ref = STDOUT
logger.grails_env.name = grails.util.Environment
logger.grails_env.level = error
logger.grails_env.additivity = false
logger.grails_env.appenderRef.stdout.ref = STDOUT
logger.prjmanager.name = grails.app.services.rundeck.services.ProjectManagerService
logger.prjmanager.level = info
logger.prjmanager.additivity = false
logger.prjmanager.appenderRef.stdout.ref = STDOUT
logger.authorization.name = com.dtolabs.rundeck.core.authorization
logger.authorization.level = info
logger.authorization.additivity = false
logger.authorization.appenderRef.stdout.ref = audit
logger.options.name = com.dtolabs.rundeck.remoteservice.http.options
logger.options.level = info
logger.options.additivity = false
logger.options.appenderRef.stdout.ref = options
logger.jobchanges.name = com.dtolabs.rundeck.data.jobs.changes
logger.jobchanges.level = info
logger.jobchanges.additivity = false
logger.jobchanges.appenderRef.stdout.ref = jobchanges
logger.execevents.name = org.rundeck.execution.status
logger.execevents.level = info
logger.execevents.additivity = false
ogger.execevents.appenderRef.stdout.ref = execevents
logger.apirequests.name = org.rundeck.api.requests
logger.apirequests.level = info
logger.apirequests.additivity = false
logger.apirequests.appenderRef.stdout.ref = apirequests
logger.access.name = org.rundeck.web.requests
logger.access.level = info
logger.access.additivity = false
logger.access.appenderRef.access.ref = access
logger.project.name = org.rundeck.project.events
logger.project.level = info
logger.project.additivity = false
logger.project.appenderRef.stdout.ref = project
logger.storage.name = org.rundeck.storage.events
logger.storage.level = info
logger.storage.additivity = false
logger.storage.appenderRef.storage.ref = storage
logger.webhook_events.name = org.rundeck.webhook.events
logger.webhook_events.level = info
logger.webhook_events.additivity = false
logger.webhook_events.appenderRef.webhooks.ref = webhooks
logger.webhook_plugins.name = org.rundeck.plugin.webhook
logger.webhook_plugins.level = debug
logger.webhook_plugins.additivity = false
logger.webhook_plugins.appenderRef.webhooks.ref = webhooks
logger.cleanup.name = rundeck.quartzjobs.ExecutionsCleanUp
logger.cleanup.level = debug
logger.cleanup.additivity = false
logger.cleanup.appenderRef.cleanup.ref = cleanup
logger.jetty.name = org.mortbay.log
logger.jetty.level = warn
logger.jetty.additivity = false
logger.jetty.appenderRef.stdout.ref = STDOUT
logger.hibernate.name = org.hibernate.orm.deprecation
logger.hibernate.level = error
logger.hibernate.additivity = false
logger.hibernate.appenderRef.stdout.ref = STDOUT
logger.rundeck_jaas.name = com.dtolabs.rundeck.jetty.jaas
logger.rundeck_jaas.level = debug
logger.rundeck_jaas.additivity = false
logger.rundeck_jaas.appenderRef.stdout.ref = STDOUT
logger.spring_security.name = grails.plugin.springsecurity.web.authentication.GrailsUsernamePasswordAuthenticationFilter
logger.spring_security.level = debug
logger.spring_security.additivity = false
logger.spring_security.appenderRef.stdout.ref = STDOUT
logger.jaas.name = org.rundeck.jaas
logger.jaas.level = debug
logger.jaas.additivity = false
logger.jaas.appenderRef.stdout.ref = STDOUT
logger.springBeanPropertyDescriptor.name = org.springframework.beans.GenericTypeAwarePropertyDescriptor
logger.springBeanPropertyDescriptor.level = error
logger.springBeanPropertyDescriptor.additivity = false
logger.springBeanPropertyDescriptor.appenderRef.stdout.ref = STDOUT
Related
I am trying to create a k8s pod with a docker container image from a private insecure registry. With the latest K8s, I get ErrImagePull as it complains of http vs https for the insecure registry.
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 7s default-scheduler Successfully assigned imagename to xxxx
Normal Pulling 7s kubelet Pulling image "registry:5000/imagename:v1”
Warning Failed 6s kubelet Failed to pull image "registry:5000/imagename:v1”: rpc error: code = Unknown desc = failed to pull and unpack image "registry:5000/imagename:v1”: failed to resolve reference "registry:5000/imagename:v1”: failed to do request: Head "https://registry:5000/v2/imagename/manifests/v1”: http: server gave HTTP response to HTTPS client
Warning Failed 6s kubelet Error: ErrImagePull
Normal BackOff 6s kubelet Back-off pulling image "registry:5000/imagename:v1”
Warning Failed 6s kubelet Error: ImagePullBackOff
Before the CRI changes for K8s (i.e. https://kubernetes.io/blog/2020/12/02/dont-panic-kubernetes-and-docker/), this has worked for me when I used to have insecure registry configuration in /etc/docker/daemon.json, however with the new changes in K8s, I am trying to understand what is the right configuration needed here.
On the same node, I am able to pull the image from the insecure registry successfully with “docker pull imagename” (since I have /etc/docker/daemon.json configuration for the insecure registry), and I have also verified with containerd command “ctr -i pull —plain-http imagename”.
What configuration is needed for this to work in a pod.yaml for me to pull this image via “kubectl create -f pod.yaml”. It's just a simple pod.yaml with the image, nothing fancy.
I saw a post on creating secret key for private registry (https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/), but that requires registry authentication token to create a key. I just tried using /etc/docker/daemon.json to create a regcred, but when I used it in imagePullSecrets in pod.yaml, k8s was still complaining of the same http vs https error.
My /etc/docker/daemon.json
{
"insecure-registries": ["registry:5000"]
}
I have a new install of K8s, and containerd is the CRI.
Thank you for your help.
I faced a similar problem recently about not being able to pull images from an insecure private docker registry using containerd only. I will post my solution here in case it works for your question too. Steps below show the details of how I solved it on Ubuntu Server 20.04 LTS:
$ containerd --version\
containerd containerd.io 1.6.4 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
insecure private docker registry running at 17.5.20.23:5000
The file /etc/containerd/config.toml gets created automatically when you install docker using .deb packages in ubuntu looks as follows:
# Copyright 2018-2022 Docker Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#disabled_plugins = ["cri"]
#root = "/var/lib/containerd"
#state = "/run/containerd"
#subreaper = true
#oom_score = 0
#[grpc]
# address = "/run/containerd/containerd.sock"
# uid = 0
# gid = 0
#[debug]
# address = "/run/containerd/debug.sock"
# uid = 0
# gid = 0
# level = "info"
In my first few attempts I was editing this file (which is created automatically) by simply adding the appropriate lines mentioned at Adding insecure registry in containerd at the end of the file and restarting containerd. This made the file look as follows:
# Copyright 2018-2022 Docker Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#disabled_plugins = ["cri"]
#root = "/var/lib/containerd"
#state = "/run/containerd"
#subreaper = true
#oom_score = 0
#[grpc]
# address = "/run/containerd/containerd.sock"
# uid = 0
# gid = 0
#[debug]
# address = "/run/containerd/debug.sock"
# uid = 0
# gid = 0
# level = "info"
[plugins."io.containerd.grpc.v1.cri".registry]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."17.5.20.23:5000"]
endpoint = ["http://17.5.20.23:5000"]
[plugins."io.containerd.grpc.v1.cri".registry.configs]
[plugins."io.containerd.grpc.v1.cri".registry.configs."17.5.20.23:5000".tls]
insecure_skip_verify = true
This did not work for me. To know why, I checked the configurations with which containerd was running (after /etc/containerd/config.toml was edited) using:
$ sudo containerd config dump
The output of the above command is shown below:
disabled_plugins = []
imports = ["/etc/containerd/config.toml"]
oom_score = 0
plugin_dir = ""
required_plugins = []
root = "/var/lib/containerd"
state = "/run/containerd"
temp = ""
version = 2
[cgroup]
path = ""
[debug]
address = ""
format = ""
gid = 0
level = ""
uid = 0
[grpc]
address = "/run/containerd/containerd.sock"
gid = 0
max_recv_message_size = 16777216
max_send_message_size = 16777216
tcp_address = ""
tcp_tls_ca = ""
tcp_tls_cert = ""
tcp_tls_key = ""
uid = 0
[metrics]
address = ""
grpc_histogram = false
[plugins]
[plugins."io.containerd.gc.v1.scheduler"]
deletion_threshold = 0
mutation_threshold = 100
pause_threshold = 0.02
schedule_delay = "0s"
startup_delay = "100ms"
[plugins."io.containerd.internal.v1.opt"]
path = "/opt/containerd"
[plugins."io.containerd.internal.v1.restart"]
interval = "10s"
[plugins."io.containerd.internal.v1.tracing"]
sampling_ratio = 1.0
service_name = "containerd"
[plugins."io.containerd.metadata.v1.bolt"]
content_sharing_policy = "shared"
[plugins."io.containerd.monitor.v1.cgroups"]
no_prometheus = false
[plugins."io.containerd.runtime.v1.linux"]
no_shim = false
runtime = "runc"
runtime_root = ""
shim = "containerd-shim"
shim_debug = false
[plugins."io.containerd.runtime.v2.task"]
platforms = ["linux/amd64"]
sched_core = false
[plugins."io.containerd.service.v1.diff-service"]
default = ["walking"]
[plugins."io.containerd.service.v1.tasks-service"]
rdt_config_file = ""
[plugins."io.containerd.snapshotter.v1.aufs"]
root_path = ""
[plugins."io.containerd.snapshotter.v1.btrfs"]
root_path = ""
[plugins."io.containerd.snapshotter.v1.devmapper"]
async_remove = false
base_image_size = ""
discard_blocks = false
fs_options = ""
fs_type = ""
pool_name = ""
root_path = ""
[plugins."io.containerd.snapshotter.v1.native"]
root_path = ""
[plugins."io.containerd.snapshotter.v1.overlayfs"]
root_path = ""
upperdir_label = false
[plugins."io.containerd.snapshotter.v1.zfs"]
root_path = ""
[plugins."io.containerd.tracing.processor.v1.otlp"]
endpoint = ""
insecure = false
protocol = ""
[proxy_plugins]
[stream_processors]
[stream_processors."io.containerd.ocicrypt.decoder.v1.tar"]
accepts = ["application/vnd.oci.image.layer.v1.tar+encrypted"]
args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"]
env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"]
path = "ctd-decoder"
returns = "application/vnd.oci.image.layer.v1.tar"
[stream_processors."io.containerd.ocicrypt.decoder.v1.tar.gzip"]
accepts = ["application/vnd.oci.image.layer.v1.tar+gzip+encrypted"]
args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"]
env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"]
path = "ctd-decoder"
returns = "application/vnd.oci.image.layer.v1.tar+gzip"
[timeouts]
"io.containerd.timeout.bolt.open" = "0s"
"io.containerd.timeout.shim.cleanup" = "5s"
"io.containerd.timeout.shim.load" = "5s"
"io.containerd.timeout.shim.shutdown" = "3s"
"io.containerd.timeout.task.state" = "2s"
[ttrpc]
address = ""
gid = 0
uid = 0
In the above output I noticed that the configurations I was trying to add by editing the /etc/containerd/config.toml were actually not there. So somehow containerd was not accepting the added configurations. To fix this I decided to start from scratch by generating a full configuration file and editing it appropriately (according to instructions at Adding insecure registry in containerd).
First took a backup of the current containerd configuration file:
$ sudo su
$ cd /etc/containerd/
$ mv config.toml config_bkup.toml
Then generated a fresh full configuration file:
$ containerd config default > config.toml
This generated a file that looked as follows:
disabled_plugins = []
imports = []
oom_score = 0
plugin_dir = ""
required_plugins = []
root = "/var/lib/containerd"
state = "/run/containerd"
temp = ""
version = 2
[cgroup]
path = ""
[debug]
address = ""
format = ""
gid = 0
level = ""
uid = 0
[grpc]
address = "/run/containerd/containerd.sock"
gid = 0
max_recv_message_size = 16777216
max_send_message_size = 16777216
tcp_address = ""
tcp_tls_ca = ""
tcp_tls_cert = ""
tcp_tls_key = ""
uid = 0
[metrics]
address = ""
grpc_histogram = false
[plugins]
[plugins."io.containerd.gc.v1.scheduler"]
deletion_threshold = 0
mutation_threshold = 100
pause_threshold = 0.02
schedule_delay = "0s"
startup_delay = "100ms"
[plugins."io.containerd.grpc.v1.cri"]
device_ownership_from_security_context = false
disable_apparmor = false
disable_cgroup = false
disable_hugetlb_controller = true
disable_proc_mount = false
disable_tcp_service = true
enable_selinux = false
enable_tls_streaming = false
enable_unprivileged_icmp = false
enable_unprivileged_ports = false
ignore_image_defined_volumes = false
max_concurrent_downloads = 3
max_container_log_line_size = 16384
netns_mounts_under_state_dir = false
restrict_oom_score_adj = false
sandbox_image = "k8s.gcr.io/pause:3.6"
selinux_category_range = 1024
stats_collect_period = 10
stream_idle_timeout = "4h0m0s"
stream_server_address = "127.0.0.1"
stream_server_port = "0"
systemd_cgroup = false
tolerate_missing_hugetlb_controller = true
unset_seccomp_profile = ""
[plugins."io.containerd.grpc.v1.cri".cni]
bin_dir = "/opt/cni/bin"
conf_dir = "/etc/cni/net.d"
conf_template = ""
ip_pref = ""
max_conf_num = 1
[plugins."io.containerd.grpc.v1.cri".containerd]
default_runtime_name = "runc"
disable_snapshot_annotations = true
discard_unpacked_layers = false
ignore_rdt_not_enabled_errors = false
no_pivot = false
snapshotter = "overlayfs"
[plugins."io.containerd.grpc.v1.cri".containerd.default_runtime]
base_runtime_spec = ""
cni_conf_dir = ""
cni_max_conf_num = 0
container_annotations = []
pod_annotations = []
privileged_without_host_devices = false
runtime_engine = ""
runtime_path = ""
runtime_root = ""
runtime_type = ""
[plugins."io.containerd.grpc.v1.cri".containerd.default_runtime.options]
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
base_runtime_spec = ""
cni_conf_dir = ""
cni_max_conf_num = 0
container_annotations = []
pod_annotations = []
privileged_without_host_devices = false
runtime_engine = ""
runtime_path = ""
runtime_root = ""
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
BinaryName = ""
CriuImagePath = ""
CriuPath = ""
CriuWorkPath = ""
IoGid = 0
IoUid = 0
NoNewKeyring = false
NoPivotRoot = false
Root = ""
ShimCgroup = ""
SystemdCgroup = false
[plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime]
base_runtime_spec = ""
cni_conf_dir = ""
cni_max_conf_num = 0
container_annotations = []
pod_annotations = []
privileged_without_host_devices = false
runtime_engine = ""
runtime_path = ""
runtime_root = ""
runtime_type = ""
[plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime.options]
[plugins."io.containerd.grpc.v1.cri".image_decryption]
key_model = "node"
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = ""
[plugins."io.containerd.grpc.v1.cri".registry.auths]
[plugins."io.containerd.grpc.v1.cri".registry.configs]
[plugins."io.containerd.grpc.v1.cri".registry.headers]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".x509_key_pair_streaming]
tls_cert_file = ""
tls_key_file = ""
[plugins."io.containerd.internal.v1.opt"]
path = "/opt/containerd"
[plugins."io.containerd.internal.v1.restart"]
interval = "10s"
[plugins."io.containerd.internal.v1.tracing"]
sampling_ratio = 1.0
service_name = "containerd"
[plugins."io.containerd.metadata.v1.bolt"]
content_sharing_policy = "shared"
[plugins."io.containerd.monitor.v1.cgroups"]
no_prometheus = false
[plugins."io.containerd.runtime.v1.linux"]
no_shim = false
runtime = "runc"
runtime_root = ""
shim = "containerd-shim"
shim_debug = false
[plugins."io.containerd.runtime.v2.task"]
platforms = ["linux/amd64"]
sched_core = false
[plugins."io.containerd.service.v1.diff-service"]
default = ["walking"]
[plugins."io.containerd.service.v1.tasks-service"]
rdt_config_file = ""
[plugins."io.containerd.snapshotter.v1.aufs"]
root_path = ""
[plugins."io.containerd.snapshotter.v1.btrfs"]
root_path = ""
[plugins."io.containerd.snapshotter.v1.devmapper"]
async_remove = false
base_image_size = ""
discard_blocks = false
fs_options = ""
fs_type = ""
pool_name = ""
root_path = ""
[plugins."io.containerd.snapshotter.v1.native"]
root_path = ""
[plugins."io.containerd.snapshotter.v1.overlayfs"]
root_path = ""
upperdir_label = false
[plugins."io.containerd.snapshotter.v1.zfs"]
root_path = ""
[plugins."io.containerd.tracing.processor.v1.otlp"]
endpoint = ""
insecure = false
protocol = ""
[proxy_plugins]
[stream_processors]
[stream_processors."io.containerd.ocicrypt.decoder.v1.tar"]
accepts = ["application/vnd.oci.image.layer.v1.tar+encrypted"]
args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"]
env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"]
path = "ctd-decoder"
returns = "application/vnd.oci.image.layer.v1.tar"
[stream_processors."io.containerd.ocicrypt.decoder.v1.tar.gzip"]
accepts = ["application/vnd.oci.image.layer.v1.tar+gzip+encrypted"]
args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"]
env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"]
path = "ctd-decoder"
returns = "application/vnd.oci.image.layer.v1.tar+gzip"
[timeouts]
"io.containerd.timeout.bolt.open" = "0s"
"io.containerd.timeout.shim.cleanup" = "5s"
"io.containerd.timeout.shim.load" = "5s"
"io.containerd.timeout.shim.shutdown" = "3s"
"io.containerd.timeout.task.state" = "2s"
[ttrpc]
address = ""
gid = 0
uid = 0
Then edited the above file to look as follows (the edited lines have been appended with the comment '# edited line'):
disabled_plugins = []
imports = ["/etc/containerd/config.toml"] # edited line
oom_score = 0
plugin_dir = ""
required_plugins = []
root = "/var/lib/containerd"
state = "/run/containerd"
temp = ""
version = 2
[cgroup]
path = ""
[debug]
address = ""
format = ""
gid = 0
level = ""
uid = 0
[grpc]
address = "/run/containerd/containerd.sock"
gid = 0
max_recv_message_size = 16777216
max_send_message_size = 16777216
tcp_address = ""
tcp_tls_ca = ""
tcp_tls_cert = ""
tcp_tls_key = ""
uid = 0
[metrics]
address = ""
grpc_histogram = false
[plugins]
[plugins."io.containerd.gc.v1.scheduler"]
deletion_threshold = 0
mutation_threshold = 100
pause_threshold = 0.02
schedule_delay = "0s"
startup_delay = "100ms"
[plugins."io.containerd.grpc.v1.cri"]
device_ownership_from_security_context = false
disable_apparmor = false
disable_cgroup = false
disable_hugetlb_controller = true
disable_proc_mount = false
disable_tcp_service = true
enable_selinux = false
enable_tls_streaming = false
enable_unprivileged_icmp = false
enable_unprivileged_ports = false
ignore_image_defined_volumes = false
max_concurrent_downloads = 3
max_container_log_line_size = 16384
netns_mounts_under_state_dir = false
restrict_oom_score_adj = false
sandbox_image = "17.5.20.23:5000/pause-amd64:3.0" #edited line
selinux_category_range = 1024
stats_collect_period = 10
stream_idle_timeout = "4h0m0s"
stream_server_address = "127.0.0.1"
stream_server_port = "0"
systemd_cgroup = false
tolerate_missing_hugetlb_controller = true
unset_seccomp_profile = ""
[plugins."io.containerd.grpc.v1.cri".cni]
bin_dir = "/opt/cni/bin"
conf_dir = "/etc/cni/net.d"
conf_template = ""
ip_pref = ""
max_conf_num = 1
[plugins."io.containerd.grpc.v1.cri".containerd]
default_runtime_name = "runc"
disable_snapshot_annotations = true
discard_unpacked_layers = false
ignore_rdt_not_enabled_errors = false
no_pivot = false
snapshotter = "overlayfs"
[plugins."io.containerd.grpc.v1.cri".containerd.default_runtime]
base_runtime_spec = ""
cni_conf_dir = ""
cni_max_conf_num = 0
container_annotations = []
pod_annotations = []
privileged_without_host_devices = false
runtime_engine = ""
runtime_path = ""
runtime_root = ""
runtime_type = ""
[plugins."io.containerd.grpc.v1.cri".containerd.default_runtime.options]
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
base_runtime_spec = ""
cni_conf_dir = ""
cni_max_conf_num = 0
container_annotations = []
pod_annotations = []
privileged_without_host_devices = false
runtime_engine = ""
runtime_path = ""
runtime_root = ""
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
BinaryName = ""
CriuImagePath = ""
CriuPath = ""
CriuWorkPath = ""
IoGid = 0
IoUid = 0
NoNewKeyring = false
NoPivotRoot = false
Root = ""
ShimCgroup = ""
SystemdCgroup = true # edited line
[plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime]
base_runtime_spec = ""
cni_conf_dir = ""
cni_max_conf_num = 0
container_annotations = []
pod_annotations = []
privileged_without_host_devices = false
runtime_engine = ""
runtime_path = ""
runtime_root = ""
runtime_type = ""
[plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime.options]
[plugins."io.containerd.grpc.v1.cri".image_decryption]
key_model = "node"
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = ""
[plugins."io.containerd.grpc.v1.cri".registry.auths]
[plugins."io.containerd.grpc.v1.cri".registry.configs]
[plugins."io.containerd.grpc.v1.cri".registry.configs."17.5.20.23:5000"] # edited line
[plugins."io.containerd.grpc.v1.cri".registry.configs."17.5.20.23:5000".tls] # edited line
ca_file = "" # edited line
cert_file = "" # edited line
insecure_skip_verify = true # edited line
key_file = "" # edited line
[plugins."io.containerd.grpc.v1.cri".registry.headers]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."17.5.20.23:5000"] # edited line
endpoint = ["http://17.5.20.23:5000"] # edited line
[plugins."io.containerd.grpc.v1.cri".x509_key_pair_streaming]
tls_cert_file = ""
tls_key_file = ""
[plugins."io.containerd.internal.v1.opt"]
path = "/opt/containerd"
[plugins."io.containerd.internal.v1.restart"]
interval = "10s"
[plugins."io.containerd.internal.v1.tracing"]
sampling_ratio = 1.0
service_name = "containerd"
[plugins."io.containerd.metadata.v1.bolt"]
content_sharing_policy = "shared"
[plugins."io.containerd.monitor.v1.cgroups"]
no_prometheus = false
[plugins."io.containerd.runtime.v1.linux"]
no_shim = false
runtime = "runc"
runtime_root = ""
shim = "containerd-shim"
shim_debug = false
[plugins."io.containerd.runtime.v2.task"]
platforms = ["linux/amd64"]
sched_core = false
[plugins."io.containerd.service.v1.diff-service"]
default = ["walking"]
[plugins."io.containerd.service.v1.tasks-service"]
rdt_config_file = ""
[plugins."io.containerd.snapshotter.v1.aufs"]
root_path = ""
[plugins."io.containerd.snapshotter.v1.btrfs"]
root_path = ""
[plugins."io.containerd.snapshotter.v1.devmapper"]
async_remove = false
base_image_size = ""
discard_blocks = false
fs_options = ""
fs_type = ""
pool_name = ""
root_path = ""
[plugins."io.containerd.snapshotter.v1.native"]
root_path = ""
[plugins."io.containerd.snapshotter.v1.overlayfs"]
root_path = ""
upperdir_label = false
[plugins."io.containerd.snapshotter.v1.zfs"]
root_path = ""
[plugins."io.containerd.tracing.processor.v1.otlp"]
endpoint = ""
insecure = false
protocol = ""
[proxy_plugins]
[stream_processors]
[stream_processors."io.containerd.ocicrypt.decoder.v1.tar"]
accepts = ["application/vnd.oci.image.layer.v1.tar+encrypted"]
args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"]
env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"]
path = "ctd-decoder"
returns = "application/vnd.oci.image.layer.v1.tar"
[stream_processors."io.containerd.ocicrypt.decoder.v1.tar.gzip"]
accepts = ["application/vnd.oci.image.layer.v1.tar+gzip+encrypted"]
args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"]
env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"]
path = "ctd-decoder"
returns = "application/vnd.oci.image.layer.v1.tar+gzip"
[timeouts]
"io.containerd.timeout.bolt.open" = "0s"
"io.containerd.timeout.shim.cleanup" = "5s"
"io.containerd.timeout.shim.load" = "5s"
"io.containerd.timeout.shim.shutdown" = "3s"
"io.containerd.timeout.task.state" = "2s"
[ttrpc]
address = ""
gid = 0
uid = 0
Then I restarted containerd
$ systemctl restart containerd
Finally I tried pulling an image from the private registry using crictl which pulled it successfully:
$ crictl -r unix:///var/run/containerd/containerd.sock 17.5.20.23:5000/nginx:latest
Image is up to date for sha256:0e901e68141fd02f237cf63eb842529f8a9500636a9419e3cf4fb986b8fe3d5d
I guess you now would have to configure containerd rather than docker to support your insecure registry. This is done in the /etc/containerd/config.toml. A config example can be found here:
Adding insecure registry in containerd
In my case, I simply added [[registry]] field into /etc/containers/registries.conf file simply because I was using crio
[[registry]]
insecure = true
location = "IP ADDRESS"
and restart crio
systemctl restart crio.service
Please refer
https://github.com/cri-o/cri-o/blob/main/docs/crio.conf.5.md
I'm trying to write error to log file in my Java desktop app but it's not working.
The error is:
2018-11-02 21:10:27,975 AWT-EventQueue-0 ERROR Unable to create file
C:UsersNhanDesktopPRJ311JDBCsrc hanloggerlogging.log
java.io.IOException: The filename, directory name, or volume label
syntax is incorrect
Here is my configuration:
status = error
name = PropertiesConfig
property.filename = C:\Users\Nhan\Desktop\PRJ311\JDBC
filters = threshold
filter.threshold.type = ThresholdFilter
filter.threshold.level = debug
appenders = rolling
appender.rolling.type = RollingFile
appender.rolling.name = RollingFile
appender.rolling.fileName = ${filename}
appender.rolling.filePattern = debug-backup-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
appender.rolling.layout.type = PatternLayout
appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
appender.rolling.policies.type = Policies
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.rolling.policies.time.interval = 1
appender.rolling.policies.time.modulate = true
appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
appender.rolling.policies.size.size=10MB
appender.rolling.strategy.type = DefaultRolloverStrategy
appender.rolling.strategy.max = 20
loggers = rolling
logger.rolling.name = nhan.views
logger.rolling.level = debug
logger.rolling.additivity = false
logger.rolling.appenderRef.rolling.ref = RollingFile
A backslash has a special meaning in a properties file per the Java Properties class. You need to escape your backslashes by adding another backslash to each of them:
C:\\Users\\Nhan\\Desktop\\PRJ311\\JDBC
The configuration for making adminLogger asynchronous using
log4j2.properties is not working. I have used the below lines to make
the logger asynchronous.
appender.adminAppender.type = RollingFile
appender.adminAppender.name = AdminAppender
appender.adminAppender.fileName = ${adminLogFile}
appender.adminAppender.filePattern = ${logPath}/admin-Backup-%i.log
appender.adminAppender.layout.type = PatternLayout
appender.adminAppender.layout.pattern = %d{yyyy.MM.dd HH.mm.ss.SSS} %-5p %c{1} [%t]: %m%n
appender.adminAppender.policies.type = Policies
appender.adminAppender.policies.size.type = SizeBasedTriggeringPolicy
appender.adminAppender.policies.size.size = 10MB
appender.adminAppender.strategy.type = DefaultRolloverStrategy
appender.adminAppender.strategy.max = 5
logger.adminLogger.type = asyncLogger
logger.adminLogger.name = admin
logger.adminLogger.level = debug
logger.adminLogger.additivity = false
logger.adminLogger.appenderRefs = adminAppender
logger.adminLogger.appenderRef.adminAppender.ref = AdminAppender
What is the correct way to configure it?
To clarify, because it was hard to explain in the title.
-- file that contains this code is > "player.lua"
local ply = FindMetaTable("Player")
ply.LastDamageType = "N/A"
this code sets a new variable to all player entities. The variable is just a string of the last entity that did damage to the player. That is made possible by the following code:
-- file that contains this code is > "init.lua"
AddCSLuaFile("shared.lua")
AddCSLuaFile("cl_init.lua")
include("shared.lua")
include("player.lua")
-->
--> OTHER METHODS THAT I DIDN'T INCLUDE
-->
function GM:PlayerShouldTakeDamage(ply, attacker)
ply.LastDamageType=tostring(attacker)
return true
end
My point of doing all this is because I want to have a hud element that will display this string so the client can see what was the last thing that dealt damage to him.
The problem is that, the variable is coming up as nil on the client side file "cl_init", yet if I printed the table that contained all the data that was in the player through the client AND through the server side. both tables were the same excluding the variable I made "LastDamageType"
-- file that contains this code is > "cl_init.lua"
include("shared.lua")
surface.CreateFont("dayz_font",{font="Arial",size=24,weight=400})
function GM:HUDPaint()
local ply = LocalPlayer()
draw.SimpleText("you are "..ply:Nick(),"dayz_font", 150,10,Color(255,120,50),TEXT_ALIGN_CENTER)//TargetID
surface.SetFont("TargetID")
surface.SetTextColor(Color(30,70,130))
surface.SetTextPos(surface.ScreenWidth()-200 ,20)
surface.DrawText("You have ")
surface.SetTextColor(Color(200,90,30))
surface.DrawText(ply:Health())
surface.SetTextColor(Color(30,70,130))
surface.DrawText(" health")
surface.SetTextPos(surface.ScreenWidth()-200 ,35)
surface.DrawText(""..tostring(Entity(1):GetTable().LastDamageType))
-- FOR DEBUGGING PURPOSES, I'M USING "Entity(1)" TO GET MY PLAYER
-- I KNOW THAT "LocalPlayer()" PROBABLY ALSO EQUATES TO THE SAME THING
-- AS WHAT "Entity(1)" IS AT THIS MOMENT BECAUSE I'M TESTING THIS IN SINGLEPLAYER.
end
So it seems that the player data on the client side and the server side are not the SAME thing and that they have to be synchronized or something like that... Or did I miss something important that kept them synchronized?
//////////////////////////////////////////////////
ADDITIONAL INFORMATION
//////////////////////////////////////////////////
These are printed lists of all the variables of my player entity when I did
PrintTable(Entity(1):GetTable())
on both the client side and server side. The first list is on the server and the second is on the client. I will separate them with ==========================
I know you don't probably want to look through the list to just to Ctrl+F and type in "LastDamageType" to highlight it.
/////////////////////////////////////////
SERVER SIDE
CWAttachments:
am_flechetterounds = true
am_magnum = true
am_matchgrade = true
am_slugrounds = true
bg_ak74_rpkbarrel = true
bg_ak74_ubarrel = true
bg_ak74foldablestock = true
bg_ak74heavystock = true
bg_ak74rpkmag = true
bg_ar1560rndmag = true
bg_ar15heavystock = true
bg_ar15sturdystock = true
bg_bipod = true
bg_deagle_compensator = true
bg_deagle_extendedbarrel = true
bg_foldsight = true
bg_longbarrel = true
bg_longbarrelmr96 = true
bg_longris = true
bg_magpulhandguard = true
bg_mp530rndmag = true
bg_mp5_kbarrel = true
bg_mp5_sdbarrel = true
bg_nostock = true
bg_regularbarrel = true
bg_retractablestock = true
bg_ris = true
bg_sg1scope = true
md_acog = true
md_aimpoint = true
md_anpeq15 = true
md_cobram2 = true
md_eotech = true
md_foregrip = true
md_kobra = true
md_m203 = true
md_microt1 = true
md_pbs1 = true
md_pso1 = true
md_saker = true
md_tundra9mm = true
CalcIdeal = 990
CalcSeqOverride = -1
DTVar = function: 0x1ca93680
EditValue = function: 0x2ac6c878
GetEditingData = function: 0x18501238
GetNetworkKeyValue = function: 0x1caf7ec0
GetNetworkVars = function: 0x1caf9640
LastDamageType = Entity [0][worldspawn]
LastPlayerTrace = 859.94995117188
LastSpawnpoint = Entity [61][info_player_start]
NetworkVar = function: 0x2375b100
NetworkVarElement = function: 0x23785a08
NetworkVarNotify = function: 0x1844e3c8
PlayerTrace:
Entity = Entity [0][worldspawn]
Fraction = 0.49089023470879
FractionLeftSolid = 0
Hit = true
HitBox = 0
HitGroup = 0
HitNoDraw = false
HitNonWorld = false
HitNormal = -1.000000 0.000000 0.000000
HitPos = 15359.968750 950.995850 -12563.697266
HitSky = true
HitTexture = TOOLS/TOOLSSKYBOX
HitWorld = true
MatType = 88
Normal = 0.998662 0.047185 -0.021163
PhysicsBone = 0
StartPos = -704.000000 192.000000 -12223.280273
StartSolid = false
SurfaceProps = 77
RestoreNetworkVars = function: 0x184b21a8
SCarMouseMoveX = 0
SCarMouseMoveY = 0
SetNetworkKeyValue = function: 0x1838a3f8
SetupEditing = function: 0x0f107ab8
SetupKeyValue = function: 0x1844da70
WT_RagdollRoper_Roping = false
canChat = 864.94995117188
dt:
m_CurrentPlayerClass:
ClassID = 125
Func = function: 0x1ca70b58
Player = Player [1][UbErZ Andrew900460]
m_bFlashlight = true
m_bInSwim = false
m_bWasNoclipping = false
m_bWasOnGround = true
////////////////////////////////////////////////////////////////
CLIENT SIDE
CWAttachments:
am_flechetterounds = true
am_magnum = true
am_matchgrade = true
am_slugrounds = true
bg_ak74_rpkbarrel = true
bg_ak74_ubarrel = true
bg_ak74foldablestock = true
bg_ak74heavystock = true
bg_ak74rpkmag = true
bg_ar1560rndmag = true
bg_ar15heavystock = true
bg_ar15sturdystock = true
bg_bipod = true
bg_deagle_compensator = true
bg_deagle_extendedbarrel = true
bg_foldsight = true
bg_longbarrel = true
bg_longbarrelmr96 = true
bg_longris = true
bg_magpulhandguard = true
bg_mp530rndmag = true
bg_mp5_kbarrel = true
bg_mp5_sdbarrel = true
bg_nostock = true
bg_regularbarrel = true
bg_retractablestock = true
bg_ris = true
bg_sg1scope = true
md_acog = true
md_aimpoint = true
md_anpeq15 = true
md_cobram2 = true
md_eotech = true
md_foregrip = true
md_kobra = true
md_m203 = true
md_microt1 = true
md_pbs1 = true
md_pso1 = true
md_saker = true
md_tundra9mm = true
CalcIdeal = 990
CalcSeqOverride = -1
ChatGestureWeight = 0
DTVar = function: 0x2be3b410
EditValue = function: 0x3053c750
GetEditingData = function: 0x2bb01b30
GetNetworkKeyValue = function: 0x2bb01d18
GetNetworkVars = function: 0x2bb01d38
LastPlayerTrace = 859.96203613281
NetworkVar = function: 0x2bb01c98
NetworkVarElement = function: 0x2bab5340
NetworkVarNotify = function: 0x2bb01cd8
PlayerTrace:
Entity = Entity [0][worldspawn]
Fraction = 0.49089023470879
FractionLeftSolid = 0
Hit = true
HitBox = 0
HitGroup = 0
HitNoDraw = false
HitNonWorld = false
HitNormal = -1.000000 0.000000 0.000000
HitPos = 15359.968750 950.995850 -12563.697266
HitSky = true
HitTexture = TOOLS/TOOLSSKYBOX
HitWorld = true
MatType = 88
Normal = 0.998662 0.047185 -0.021163
PhysicsBone = 0
StartPos = -704.000000 192.000000 -12223.280273
StartSolid = false
SurfaceProps = 77
RestoreNetworkVars = function: 0x2bb01d58
SetNetworkKeyValue = function: 0x2bb01cf8
SetupEditing = function: 0x2bb01c38
SetupKeyValue = function: 0x2bb01c58
dt:
m_CurrentPlayerClass:
ClassID = 125
Func = function: 0x30283ff8
Player = Player [1][UbErZ Andrew900460]
m_bInSwim = false
m_bWasNoclipping = false
m_bWasOnGround = true
If you wish to have a network shared variable that you can assign to an entity (e.g. a player) you want to use NWVariables. In your situation, since you are saving an entity you want to look at SetNWEntity and GetNWEntity.
Here is how you would implement it in the PlayerShouldTakeDamage hook:
function GM:PlayerShouldTakeDamage(ply, attacker)
ply:SetNWEntity("LastDamageType", attacker)
return true
end
For some reason my HHVM setup crashes after the initial 12 requests (jit_warmup_requests). I can't see any useful information as to why this is in the logs. If I disable JIT it works fine and if I increase the "jit_warmup_requests" to 20 for example I only get 7 successful requests.
HHVM Version 3.5.0
NGINX Version 1.6.2
Ubuntu 14.04.1 LTS
Here is my server.ini
; php options
pid = /var/run/hhvm/pid
; hhvm specific
hhvm.server.port = 9001
hhvm.server.type = fastcgi
hhvm.server.default_document = index.php
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
hhvm.server.apc.enable_apc = true
hhvm.server.apc.table_type = concurrent
hhvm.server.apc.expire_on_sets = true
hhvm.server.apc.purge_frequency = 4096
hhvm.jit = true
hhvm.eval.jit = true
hhvm.eval.jit_warmup_requests = 20
hhvm.log.level = Error
hhvm.log.no_silencer = true
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.log.use_log_file = true
hhvm.log.use_syslog = false
hhvm.log.injected_stack_trace = true
hhvm.log.native_stack_trace = true
hhvm.log.file = /var/log/hhvm/error.log
hhvm.error_handling.call_user_handler_on_fatals = true
hhvm.error_handling.max_loop_count = 0
hhvm.error_handling.no_infinite_recursion_detection = false
hhvm.error_handling.throw_bad_type_exceptions = false
hhvm.error_handling.throw_too_many_arguments = false
hhvm.error_handling.warn_too_many_arguments = false
hhvm.error_handling.throw_missing_arguments = false
hhvm.error_handling.throw_invalid_arguments = false
hhvm.error_handling.enable_hip_hop_errors = true
hhvm.error_handling.notice_frequency = 1
hhvm.error_handling.warning_frequency = 1
hhvm.error_handling.assert_active = false
hhvm.error_handling.assert_warning = false
hhvm.debug.full_backtrace = true
hhvm.debug.server_stack_trace = true
hhvm.debug.server_error_message = true
hhvm.debug.translate_source = true
hhvm.debug.record_input = false
hhvm.debug.clear_input_on_success = true
hhvm.debug.profiler_output_dir = /tmp
hhvm.debug.core_dump_email = email address
hhvm.debug.core_dump_report = true
hhvm.debug.core_dump_report_directory = /tmp
Any help on this would be greatly appreciated :)