Tmp目录丢失引发Java进程异常

今天早上想打开dapeng-cli监控一下线上服务, 登录服务器后, 没想到居然打不开:

[logview@monitor-elk dapeng-cli]$ ./dapengCli
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/dapeng-cli/plugins/jline-2.14.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/dapeng-cli/plugins/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Exception in thread "main" java.util.ServiceConfigurationError: org.clamshellcli.api.Plugin: Provider org.clamshellcli.impl.CliConsole could not be instantiated
    at java.util.ServiceLoader.fail(ServiceLoader.java:232)
    at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at org.clamshellcli.core.Clamshell$Runtime.loadServicePlugins(Clamshell.java:66)
    at cli.Run.main(Run.java:105)
Caused by: java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi in java.library.path, No such file or directory]
    at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:182)
    at org.fusesource.hawtjni.runtime.Library.load(Library.java:140)
    at org.fusesource.jansi.internal.CLibrary.(CLibrary.java:42)
    at org.fusesource.jansi.AnsiConsole.wrapOutputStream(AnsiConsole.java:48)
    at org.fusesource.jansi.AnsiConsole.(AnsiConsole.java:38)
    at org.clamshellcli.impl.CliConsole.(CliConsole.java:71)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
    ... 4 more

no jansi in java.library.path, 这可是从来没出现过的错误, 通过各种花式搜索, 找到的都是不着边际的答案.

然后过了10来分钟, 不少业务团队过来抱怨定时任务失效. 我们的定时任务也是在上面的服务器中通过crontab来触发定时任务的.
这时候, 发现定时任务只能查看不能修改, 现状如下:

[root@monitor-elk ~]# crontab -l
*/1 * * * * sh /data/scripts/synccp.sh /data
05 0 * * *  sh /data/scripts/serviceMonitor.sh /data/logs/
[root@monitor-elk ~]# crontab -e
/tmp/crontab.nUAdxv: 没有那个文件或目录

然后一番折腾, 运维大哥发现是/tmp目录给删除了(早上有人改了某个脚本, 该脚本会定时删除/tmp目录). 重建/tmp目录后, 一切回复正常(当然也要修正那个错误的脚本).

你可能感兴趣的:(Tmp目录丢失引发Java进程异常)