<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>coffee_kabu</author_name>
  <author_url>https://blog.hatena.ne.jp/coffee_kabu/</author_url>
  <blog_title>Bus errorとSegmentation faultに困ったら見るブログ</blog_title>
  <blog_url>https://coffee-guhaw.hateblo.jp/</blog_url>
  <categories>
    <anon>python</anon>
    <anon>シェルコマンド/シェルスクリプト</anon>
    <anon>debian</anon>
  </categories>
  <description>cgi-binからpythonスクリプトを起動する このとき、すでにそのスクリプトが走っていると多重起動することになる たぶんちゃんと動くけど、実行速度が遅くなってしまうのでよろしくないそこで、同時に同じスクリプトが走らないような仕組みを作る必要がある 最初に見つけたのはこの記事■ 過去記事 : pythonでプロセスの多重起動を防ぐpython内で、シェルコマンドのpsとかgrepを走らせてその返り値が1かどうかを見てる 1なら同名のスクリプトは1つしか走っていないけど、実際にこれを動かしてみると、子プロセスがめっちゃできたのと、 もし同じプロセスが4つ走ったときにそれが順次終了していくのを…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcoffee-guhaw.hateblo.jp%2Fentry%2F2025%2F05%2F06%2F120000&quot; title=&quot;【python3】PIDを比較することで多重起動を防ぐ - Bus errorとSegmentation faultに困ったら見るブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn.image.st-hatena.com/image/square/23ff597bd045490499b097f036afb3ec0665a0d5/backend=imagemagick;height=80;version=1;width=80/https%3A%2F%2Fcdn.user.blog.st-hatena.com%2Fcircle_image%2F88409737%2F1514352962196085</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-05-06 12:00:00</published>
  <title>【python3】PIDを比較することで多重起動を防ぐ</title>
  <type>rich</type>
  <url>https://coffee-guhaw.hateblo.jp/entry/2025/05/06/120000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
