0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WSLが1分で落ちる問題

困ったものです。
Cloudflare Tunnelから通知来てビックリ。
さて、どうしたものか。
え、WSLがわからない?
WSLについて(リンク:Wikipedia)


対策1 大人しくVPSに乗り換える

はお金ないので却下


対策2 デーモンとかを動かす

なんかDockerを動かし続けると落ちないよってAIさんいうのでGrowi動かし、exitして1分後


[Alert]
Tunnel "wslotiruna" is down

終わった。


対策3 wslコマンドを叩き続ける

WSLは、「一定期間(1分ほど)wslコマンドなどが実行されていないのであればstopped!」らしいので、定期的に実行すればいいじゃないか
ってことを
すでにやってる方がいました(グスン)
*****t様ですね。
これの記事に助けられました。
やり方を言ってしまうと
VBS書いて実行してサービス入れば永久起動です。

Set ws = CreateObject("Wscript.Shell")
ws.run "cmd /c wsl", vbhide

まんまパクりましたごめんなさい

Set ws = CreateObject("Wscript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
logPath = "C:\wsl_start.log"
Set log = fso.OpenTextFile(logPath, 8, True)
log.WriteLine "============================="
log.WriteLine "WSL 起動: " & Now
ws.Run "cmd /c wsl", 0, True
log.WriteLine "WSL 終了: " & Now
log.Close

これで許して
以上!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?