라즈베리파이 파이썬 스크립트 자동실행 해제

skyjjogari의 이미지

라즈베리파이에 라즈비안 OS를 올리고 파이썬으로 코딩하여 테스트 중입니다.

/etc/xdg/lxsession/LXDE-pi/autostart의 내용에 해당 실행파일 (.py파일)을 실행하게하여 부팅시 자동실행이 되게끔 설정하였습니다.

그런데 해당 소스에 try-exception 구문을 넣어서 에러 발생 시 reboot을 하게 하는 바람에..

부팅하고 실행되면 바로 리붓이 되어 아무것도 할 수 없는 상황이 되었습니다.

질문의 요지는 다음과 같습니다.

<다음>

1. OS를 Write한 SD카드를 포멧하지 않고, 현재 부팅 시 자동실행 되는 상황을 해제 하는 방법이 있습니까?

2. 만약 불가능하다면 SD카드를 PC에 인식시켜서 해당 실행파일만 따로 copy를 할 수 있는 방법이 있습니까?

고수 분들의 많은 고견 부탁드립니다.

감사합니다.

twinwings의 이미지

2. SD카드 리더기를 일반 데스크탑에 연결해서 루트 권한으로

/etc/xdg/lxsession/LXDE-pi/autostart

수정하시면 됩니다.

skyjjogari의 이미지

SD카드 리더기를 일반 데스크탑에 연결하면 라즈비안OS관련 파일들만 나오고 위의 경로는 없습니다.

다른 방법은 없을까요?

twinwings의 이미지

윈도에서 연결하셨나요?

제 기억에 떠야 정상인데..

해당 경로의 파티션이 분리되어 있으면(부팅 파티션과)

수동으로 마운트해줘도 가능하구요.

skyjjogari의 이미지

디스크 잡혀서 열기하면,

/etc/xdg/lxsession/LXDE-pi/autostart 와 같은

라즈베리파이에서 부팅해서 볼 수 있는 폴더 및 파일이 있는 것이 아닌,

라즈비안을 부팅할 수 있게하는 OS용 파일들만 있다고 말씀 드린 사항입니다ㅠㅠ

ㅁasdasd의 이미지

어떻게 해결하셨나요 ㅜㅜ

nkastar의 이미지

제 경우는 /etc/profile에 자동 실행 스크립트 작성했습니다.
ctrl, alt 및 F1으로 터미널 실행
sudo nano /etc/profile
해당 파이썬 스크립트 찾아서 삭제(또는수정 등) --> ctrl X로 저장
reboot로 해결했습니다

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.